Book HomeCascading Style Sheets: The Definitive GuideSearch this book Saturday 23rd of August 2014 03:32:50 AM

10.6. Borders

In CSS1, there are quite a few properties devoted to setting borders around element boxes, such as border-top-width and border-color, not to mention border itself. CSS2 adds a even more border properties, most of which are aimed at giving the author even more specific control of the borders. Before, it was difficult to set a specific color or style for a given side of the border, except through properties like border-left, and that could require more than one value. The new CSS2 properties address this, and their names are pretty self-explanatory:



In practice, only browsers released in early 1999 or later correctlyhandle auto, and not even all of them get itright. Those that do not handle auto marginscorrectly will behave in inconsistent ways, but the safest bet is toassume that they will set both margins to zero. The browsers that doget this right are Internet Explorer 4.5 and 5 for Macintosh, andOpera 3.6.

border-bottom-style border-left-style

Library Navigation Links

Copyright © 2002 O'Reilly & Associates. All rights reserved.

1.4.2. The STYLE Element

The STYLE element, which is a relatively new element in HTML, is the most common way to define a style sheet, since it appears in the document itself. STYLE should always use the attribute TYPE; in the case of a CSS1 document, the correct value is text/css, just as it was with the LINK tag. So, the STYLE container should always start with <STYLE