Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

CSS border-color property

CSS border-color property

Example

Set the colors of the four borders:

p

{

border-style:solid;

border-color:#ff0000 #0000ff;

}

Try it »


Property definition and usage

The border-color property sets the colors of all four borders of an element. This property can have one to four values.

Example:

border-color: red, green, blue, pink;

border-color: red, green, blue;

border-color: red, green;

border-color: red;

**Note:** Always declare the border-style property before the border-color property. An element must have a border before you can change its color.

Default value: not specified
Inherited: no
Version: CSS1
JavaScript syntax: object object.style.borderColor="#FF0000 blue"

Browser support

The numbers in the table indicate the first browser version that supports this property.

property
border-color 1.0 4.0 1.0 1.0 3.5

Attribute values

Value Description
color Specifies the background color. SeeCSS color valuesFind the complete list of color values
transparent Specifies that the border color should be transparent. This is the default
inherit Specifies that the border color should be inherited from the parent element

Related Articles

CSS Tutorial: CSS Border