Easy Tutorial
❮ Css3 Pr Text Shadow Pr Text Text Align ❯

CSS border-top-color Property

Example

Set the top border color:

p {
    border-style: solid;
    border-top-color: #ff0000;
}

Property Definition and Usage

The border-top-color property sets the color of an element's top border.

Note: Always declare the border-style property before the border-top-color property. The element must have a border before you can change the color.

Default value: not specified
Inherited: no
--- ---
Version: CSS1
--- ---
JavaScript syntax: object.style.borderTopColor="blue"
--- ---

Browser Support

The numbers in the table specify the first browser version that fully supports the property.

Property
border-top-color 1.0 4.0 1.0 1.0 3.5

Property Values

Value Description
color_name Specifies a border color by name (e.g., red).
hex_number Specifies a border color by a hex value (e.g., #ff0000).
rgb_number Specifies a border color by an rgb code (e.g., rgb(255,0,0)).
transparent 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: border-top Property

❮ Css3 Pr Text Shadow Pr Text Text Align ❯