Book HomeCascading Style Sheets: The Definitive GuideSearch this book Tuesday 02nd of September 2014 01:31:42 PM
would have appeared is simply closed up, and the positioned text overlaps the some of the content. There is no way to avoid this, short of positioning the boldfaced text outside of the paragraph (by using a negative value for right) or by specifying a padding for the paragraph that is wide enough to accommodate the positioned element. Also, since it has a transparent background, the parent element's text shows through the positioned element. The only way to avoid this is to set a background for the positioned element.

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, which is given an overview in the next chapter.



Library Navigation Links

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

DIV. As we can see, the end of theDIV is actually above the visual bottom of itschild paragraph. The next element after the DIV isthe appropriate distance from the bottom of theDIV. The fact that it overlaps the paragraphdoesn't matter, at least not technically.

Now let's consider an example where the margins of a list item,an unordered list, and a heading are all collapsed. In this case, theunordered list and heading will be set to have negative margins: