Border Color
Border Color
The border-color
property specifies the color of an element's four borders. It is a shorthand for choosing the top, right, bottom, and left border color simultaneously. When one value is specified, it applies the same color to all four sides.
Examples
Red Borders
Set all four borders of a <h1>
element to red.
h1{
border-style: solid;
border-color: red;
}
Different Border Colors
Setting the four borders of a <h1>
Element to different colors.
h1{
border-style: solid;
border-color: red green blue purple;
}
Syntax
border-color: value;
Tips
- Always declare the
border-style
property before theborder-color
property.
Additional Information
For more information, see http://www.w3schools.com/cssref/pr_border-color.asp.
Found a bug in the documentation? Let us know at support@code.org.