The border-color property sets the color of the border surrounding the selected element(s).
The colors for each side may be set individually using the border-bottom-color, border-left-color, border-right-color, and border-top-color properties.
Inherited: No
You can specify from one to four different color values (see Table B-2) to specify different colors for each side of the element, as shown in Table B-2. Note that Netscape 4 supports only a single border color value.
Number of values | Effect on borders |
---|---|
1 | All four borders receive the value specified. |
2 | Top and bottom (horizontal) borders receive the first value, left and right (vertical) borders receive the second. |
3 | Top border receives the first value, vertical borders receive the second, bottom border receives the third. |
4 | Values are applied to top, right, bottom, and left borders, respectively. |
Initial value: The color property of the element, which may be inherited if not explicitly specified.
CSS Version: 1
Works in all CSS-compatible browsers, including Internet Explorer 4 or later and Netscape 4 or later. Netscape 4 supports only a single border color value.
This style rule puts blue borders on the top and bottom and red borders on the left and right sides of blockquote elements:
blockquote { border-style: solid; border-color: blue red; }