Saturday 01st of November 2014 12:35:15 PM

Book Home

Cascading Style Sheets: The Definitive GuideSearch this book

Symbols | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z

Index: Y

There are no index entries for this letter.


Symbols | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z


Library Navigation Links

styledeclarations will appear at the top of your page! (Of course, thebrowser should ignore the text because it isn't part of theBODY element, but this is never the case.) Thisproblem is illustrated in Figure 1-5.

Figure 1-5

Figure 1-5. Older browsers will literally display your style sheets

In order to combat thisproblem, it is recommended that you enclose your declarations in acomment tag. In the example Copyright © 2002 O'Reilly & Associates, Inc. All Rights Reserved.

7.3.7. Margins and Inline Elements

So far, we've only talkedabout how margins apply to block-level elements like paragraphs andheaders. Margins can also be applied to inline elements, although theeffects are a little different.

Let's say that you want to set top and bottom margins onboldfaced text. You declare: automatically. This can have unintended effects. Consider thefollowing:

H4 {border-style: dashed solid double;}H4 {border: medium green;}

This will result in H4 elements having no borderat all, because the lack of a border-style in the second rule meansthat the default value of none will be used. Aswe've seen, that will turn the border off altogether.