Style borderTop Property
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:
- border-top-width
- border-top-style
- border-top-color
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





All major browsers support the borderTop property.
Example
Example
Change the width, style, and color of the top border:
This is some text.
Try it »
The Style object