Colors values may be specified in any of the methods outlined in Chapter 16 and Appendix D. If no border color is declared, the default is the foreground color for the element (i.e., the text color for text elements).
The border-color shorthand
property is demonstrated in this example and in Figure 19-10.
div {border: 6px solid;
border-color: #333 #666 #999 #CCC; }
Figure 19-10. The border-color property
CSS 2 added the transparent
value that allows the background of the parent element to show through
the border, yet holds the width of the border as specified. This may
be useful when creating rollover effects with CSS (this technique is
explained in Chapter 24), because
the space where the border will appear is maintained when the mouse is
not over the element.
Tip
Unfortunately, the transparent value is not supported in
Internet Explorer for Windows through Version 6. Support in IE 7 (in
beta as of this writing) is possible, but not documented.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access