Style borderTopWidth Property
The Style object
Definition and Usage
The borderTopWidth property sets or returns the width of an element's top border.
Syntax
Set the borderTopWidth property:
Object.style.borderTopWidth="thin|medium|thick|
length
|inherit"
Return the borderTopWidth property:
Object.style.borderTopWidth
| Value | Description |
|---|---|
| thin | Defines a thin border. |
| medium | Default. Defines a medium border. |
| thick | Defines a thick border. |
| length | Defines the width of the border using units such as px and cm. |
| inherit | The width of the top border is inherited from the parent element. |
Browser support





All major browsers support the borderTopWidth property.
**Note:** IE7 and earlier versions do not support the "inherit" value. IE8 supports "inherit" only if a !DOCTYPE is specified. IE9 supports "inherit".
Example
Example
Change the width of the top border:
This is some text.
Try it »
The Style object