B.16. border-color

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

B.16.1. Value

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.

Table B-2. Effects of multiple values on border properties
Number of valuesEffect on borders
1All four borders receive the value specified.
2Top and bottom (horizontal) borders receive the first value, left and right (vertical) borders receive the second.
3Top border receives the first value, vertical borders receive the second, bottom border receives the third.
4Values 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.

B.16.2. Compatibility

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.

B.16.3. Example

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;
}

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset