Book HomeCascading Style Sheets: The Definitive GuideSearch this book Sunday 25th of February 2018 10:22:01 PM

3.6. Summary

Units and values cover a wide spectrum of areas, from length units to color units to the location of files (such as images). For the most part, units are the one area that user agents get almost totally correct; it's those few little bugs and quirks that get you, though. Interpreting relative URLs incorrectly, for example, has bedeviled many authors, and leads to an over-reliance on absolute URLs. Colors are another area where user agents almost always do well, except for a few little quirks here and there. The vagaries of length units, however, far from being bugs, are an interesting problem for any author to tackle.

These units all have their advantages and drawbacks, depending on the circumstance in which they're used. We've already seen some of these, and the nuances of such circumstances will be discussed in the rest of the book, beginning with the CSS properties that describe ways to alter the way text is displayed.



you're having this problem, then you'll need to contactyour ISP and explain the problem. If they refuse to fix it, tryexplaining to them that IANA (the Internet Assigned NumbersAuthority, which also approves MIME types) has approved.css as the extension for the MIME typetext/css, and the slideshow mapping is not arecognized IANA MIME type.

If they still refuse to correct the problem, then you may be able tofix it yourself with a directive file in your web space. If your web Library Navigation Links

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

<IMG SRC="test1.gif" STYLE="margin: 5px;" ALT="first test">
<IMG SRC="test2.gif" STYLE="margin: 5px;" ALT="second test">

(Note that the images in Figure 8-6 are actually inline elements, but they effectively demonstrate that horizontally adjacent margins do not collapse.)

Figure 8-6

Figure 8-6. Horizontal margins don't collapse

Almost as simple is this: the sum of the horizontal components of a nonfloated block-level element box always equals thesplash.css, the markup would look like this:

<LINK REL="stylesheet" TYPE="text/css" HREF="basic.css"><LINK REL="stylesheet" TYPE="text/css" HREF="splash.css">

This will cause the browser to load both style sheets, combine therules from each, and apply the result to the document (see Figure 1-3). We'll see exactly how the sheets arecombined in the next chapter, but for now, let's just acceptthat they're combined. For example:

<LINK REL="stylesheet" TYPE="text/css" HREF="sheet-a.css">nearest block-level ancestor. This is true even in relative
positioning, although it might not seem so at first.

  • For nonroot elements that are absolutely positioned using a position of absolute, the containing block is set to the nearest ancestor (of any kind) that has a position other than static. This happens as follows: