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

6.3. Summary

Setting colors and backgrounds on elements gives authors a great deal of power in CSS. The advantage of CSS over traditional methods is that colors and backgrounds can be applied to any element in a document -- not just table cells, for example, or anything enclosed in a FONT tag. Despite a few bugs in some implementations, like Navigator 4's reluctance to apply a background to the entire content area of an element, these are very widely used properties. Their popularity isn't too hard to understand, either, since color is one easy way to distinguish the look of one page from another.

CSS allows for a great deal more in the way of element styling, however: borders that can be placed on any element, extra margins and padding, and even a way to "float" elements other than images. These are all covered in the next chapter.

Library Navigation Links

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

Finally,we come to text-decoration, which is a fascinating property that carries along a whole truckload of oddities and inconsistencies in browsers. First, however, let's talk about how it should work in theory.

Figure 4-57. Various kinds of text decoration


It's impossible to show the effect of blink in print, of course, but it's easy enough to imagine. User

The most complicated screen in the system is the record display screen. Composed of three areas -- the system navigation bar, a sidebar with current options, and the record display itself -- it's structured around a table, with each area being enclosed in a table cell. In addition, there is a fourth table cell between the sidebar and the main part of the page, in order to create some blank space. There are also a lot of FONT tags and a few tables imbedded within the main table that determines the page's layout. The skeleton of the page is expressed as a table, with asuch as these can quite obviously be dangerous and is rarely worth the trouble -- but it can also be rewarding. It takes a good deal of practice, and many mistakes, to learn to tell the difference between the two.

7.3.7. Margins and Inline Elements

So far, we've only talked about how margins apply to block-level elements like paragraphs and

P.starry {background-image: url(;background-color: black; color: white;}<P CLASS="starry">It's the end of autumn, which means the stars will bebrighter than ever!  Join us...

Besides, if you have the image do something other than fully tileacross the entire background of the document, then you'll needa color to cover the parts that the image doesn't. Speaking ofwhich ...