CSS border-topProperty
Example
Set the style of the top border:
p
{
border-style:solid;
border-top:thick double #ff0000;
}
{
border-style:solid;
border-top:thick double #ff0000;
}
Try it Yourself »
Property definition and usage instructions
The border-top shorthand property sets all the properties for the top border in one declaration.
YespressSequenceSettingsFor exampleBottomAttributes: border-top-width, border-top-style, and border-top-color.
If you do not set one of the values, no problem occurs; for example, border-top: solid #ff0000; is also allowed.
| Default value: | not specified |
|---|---|
| Inheritance: | no |
| version: | CSS1 |
| JavaScript Syntax: | object.style.borderTop="3px solid blue" |
Browser Support
The numbers in the table indicate the first browser version number that supports this property.
| Property | |||||
|---|---|---|---|---|---|
| border-top | 1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
Property value
| Value | Description |
|---|---|
| border-top-width | Specifies the width of the top border. See:border-top-widthpossible value in |
| border-top-style | Specifies the style of the top border. See:border-top-stylepossible value in |
| border-top-color | Specifies the color of the top border. See:border-top-colorpossible value in |
| inherit | Specifies that the setting of the border-top property should be inherited from the parent element. |
Related Articles
CSS Tutorial:CSS Border
other extensions