CSS border-top-widthProperty
Example
Set the width of the top border:
p
{
border-style:solid;
border-top-width:15px;
}
{
border-style:solid;
border-top-width:15px;
}
Try it Yourself »
Property Definition and Usage Instructions
The border-top-width property sets the width of an element's top border.
Note:Always declare the border-style property before the border-top-width property. An element must have borders before you can change the width of its borders.
| Default Value: | medium |
|---|---|
| Inherited: | no |
| version: | CSS1 |
| JavaScript Syntax: | object object.style.borderTopWidth="thick" |
Browser Support
The number in the table specifies the first browser version that fully supports the property.
| Property | |||||
|---|---|---|---|---|---|
| border-top-width | 1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
Property value
| Value | Description |
|---|---|
| thin | Defines a thin top border. |
| medium | Default value. Defines a medium top border. |
| thick | Defines a thick top border. |
| length | Allows you to customize the width of the top border. |
| inherit | Specifies that the border width should be inherited from the parent element. |
Related Articles
CSS Tutorial:CSS Border
CSS Reference Manual:border-top Property
other extensions