CSS border-top-color property
Set the color of the top border:
{
border-style:solid;
border-top-color:#ff0000
}
Try it out . . .
Description of property definition and use
Border-top-color sets the color of the upper border of the element.
Note: Always declare the border-style property before the border-top-color property. The element must get the border before you change its color.
Default: | not specified |
---|---|
Inheritance: | no |
Version: | CSS1 |
JavaScript syntax: | object .style.borderTopColor="blue" |
Browser support
The numbers in the table support the first browser version number of the property.
Attributes | |||||
---|---|---|---|---|---|
border-top-color | 1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
Property Values
Value | Describe |
---|---|
color_name | A border color (such as red) that specifies a color value as a color name. |
hex_number | A border color that specifies a color value of heteens, such as #ff0000. |
rgb_number | A border color that specifies a color value of rgb code (e.g. rgb (255,0,0)." |
transparent | The default. The border color is transparent. |
inherit | Specifies that the border color should be inherited from the parent element. |
Related articles
CSS tutorial: CSS Border
CSS Reference Manual: Border-top Property