Book HomeCascading Style Sheets: The Definitive GuideSearch this book Wednesday 13th of December 2017 08:04:26 PM

1.5. Summary

In order to facilitate a return to structural HTML, something was needed to permit authors to specify how a document should be displayed. CSS fills that need very nicely, and far better than the various presentational HTML elements ever did (or probably could have done). For the first time in years, there is hope that web pages can become more structural, not less, and at the same time the promise that they can have a more sophisticated look than ever before.

First we consider the use of theLINK tag. The LINK tag is alittle-regarded but nonetheless perfectly valid tag that has beenhanging around the HTML specification for years, just waiting to beput to good use. Its basic purpose is to allow HTML authors toassociate other documents with the document containing theLINK tag. CSS1 uses it to link style sheets to theHTML document; in Figure 1-2, a style sheet calledsheet1.css is linked to thedocument.

In order to ensure that this transition goes as smoothly as possible, HTML introduces a number of ways to link HTML and CSS together while still keeping them distinct. This allows authors to simplify document appearance management and maximize their effectiveness, thereby making their jobs a little easier. The further benefits of improving accessibility and positioning documents for a switch to an XML world make CSS a compelling technology.

As for user agent support, the LINK element has been universally supported, as have both the STYLE element and attribute. @import didn't fare so well, though, being ignored outright by Navigator 4. This is not such a major tragedy, annoying though it might be, since the LINK element will still let you bring external style sheets into play.

In order to fully understand how CSS can do all of this, authors need a firm grasp of how CSS handles document structure, how one writes rules that behave as expected, and most of all, what the "Cascading" part of the name really means.



Library Navigation Links

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

to be whichever limit they exceed, but you can't necessarily count on this. As an example, Netscape Navigator 4.x will not ignore or clip an invalid color value, but will instead perform some sort of magic translation to yield a totally unexpected color.

3.1.2.5. Bringing the colors together

Table 3-4 presents an overview of the colors we've discussed. Italicized color names are those that can be