Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Style borderTop Property

Style borderTop Property

Style Object Reference The Style object


Definition and Usage

The borderTop property sets or returns three individual top border properties in shorthand form.

With this property, you can set/return:

Syntax

Set the borderTop property:

Object.style.borderTop="

width style color

"

Return the borderTop property:

Object.style.borderTop

**Tip:** The borderTop property has no default value.

Parameters Description
width Sets the width of the top border.
style Sets the style of the top border.
color Sets the color of the top border.

Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the borderTop property.


Example

Example

Change the width, style, and color of the top border:

Runoob Tutorial(runoob.com)
This is some text.

Try it »


Style Object Reference The Style object