Book HomeCascading Style Sheets: The Definitive GuideSearch this book Friday 31st of October 2014 05:40:55 AM

9.6. Summary

When it comes right down to it, positioning is a very compelling technology. It's also likely to be an exercise in frustration if you're trying to get it to behave consistently in a cross-browser environment. The problem isn't so much that it won't work in some browsers: it's that it will only sort of work in a number of them, such as Navigator 4 and Internet Explorer 4 and 5. It can be great fun to play with positioning, and one day we'll be able to use it in place of tables and frames while dramatically improving accessibility and backward compatibility. As of this writing, though, it remains a great way to create design prototypes, but a tricky thing to use on a public web site.

As it happens, this sentiment may be applied to the majority of CSS2,

4.1.2. The Height of Lines

As opposed to the size of a font, which will be discussed in Chapter 5, "Fonts", line-height refers to the distance between the baselines of lines of text -- sort of. In fact, this property determines the amount by which the height of each element's line box is increased or decreased. In the simplest cases, it's which is given an overview in the next chapter.

Library Navigation Links

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

has a line-height of 12px,since line-height is an inherited property. Whathappens is that the difference between font-sizeand line-height is divided in half, and thenapplied to the top and bottom of each element's content-heightto arrive at the inline box. Each halfof the divided difference is referred to ashalf-leading.

the border, but the background has to go through the padding before it even gets to the border.

The default value of padding is 0 (zero), and padding values cannot be negative.


Opera 3.5 allows negative padding values, but this was fixed in Opera 3.6. The other browsers don't allowDIV.fixbg {background-attachment: fixed;}


This sets the background color of an element. The color fills the content area and padding, and extends out to the outer edge of the element's border. The value transparent trips across a nasty bug in Navigator 4.x, which interprets it as black.


Sets an