CSS border-top-color property
Examples
Set the color of the top border:
p
{
border-style:solid;
border-top-color:#ff0000
}
{
border-style:solid;
border-top-color:#ff0000
}
Attribute definitions and instructions
Element is set on the border color border-top-color.
Note: Always put before the border-top-color border-style attribute to the property declaration.Border element must be obtained before you change its color.
Defaults: | not specified |
---|---|
Inherited: | no |
version: | CSS1 |
JavaScript syntax: | object .style.borderTopColor = "blue" |
Browser Support
Figures in the table represent the first browser to support the version number of the property.
属性 | |||||
---|---|---|---|---|---|
border-top-color | 1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
Property Values
value | description |
---|---|
color_name | Predetermined color border color color name (for example, red). |
hex_number | Color border color is specified in hexadecimal value (such as # ff0000). |
rgb_number | Rgb color value specified border color code (eg rgb (255,0,0)). |
transparent | Defaults. Border color transparent. |
inherit | Provisions border color should inherit from the parent element. |
related articles
CSS tutorial: CSS Border
CSS Reference: border-Top properties