Book HomeCascading Style Sheets: The Definitive GuideSearch this book Wednesday 24th of January 2018 04:43:14 AM

Copyright © 2000 O'Reilly & Associates, Inc. All rights reserved.

Printed in the United States of America.

Published by O'Reilly & Associates, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.

Nutshell Handbook, the Nutshell Handbook logo, and the O'Reilly logo are registered trademarks of O'Reilly & Associates, Inc. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and O'Reilly & Associates, Inc. was aware of a trademark claim, the designations have been printed in caps or initial caps. The association between the image of a koala and the topic of HTML and XHTML is a trademark of O'Reilly & Associates, Inc.

While every precaution has been taken in the preparation of this book, the publisher assumes no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein.

Library Navigation Links the three list items. Since we explicitly turned off link underlining, the only visual difference between the anchors and normal text is the color.

Figure 4-58

Figure 4-58. Suppressing the underlining of hyperlinks


Although I personally don't have a problem with it, many users have a tendency to get violently annoyed when they realize you've turned off link underlining. Obviously, it's a matter of opinion, so let your own tastes be your guide -- but

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

tag.  You can count on all browsers having the basic fonts--Arial, Courier and Times Roman--but browsers that don't have the font you specify will simply substitute some other font, and the effect you want may be diminished or lost.  The <BASEFONT> or <FONT> tags can list multiple fonts in order of preference.  The list should include a generic font family as a last resort, e.g.
   <FONT FACE="Creepy, Times New Roman, serif">
Generic font families include serif, sans-serif, monospace, cursive and fantasy

Margins are also contained within the line box, but they have theirown wrinkle. Setting a positive margin is no mystery: it will simplymake the line box taller, as in Figure 8-67.

Figure 8-67

Figure 8-67. Adding padding, borders, and margins to an inline replaced element

Setting negative margins, meanwhile, has exactlythe effect you might expect: it makes the line-box shorter. This isillustrated in Figure 8-68, where we can see theline above the image has been pulled down toward it.

Remember that if you float atextelement, its width will tend toward zero. This is exactly theopposite of the normal horizontal rules, wherewidth is increased until the seven propertiesequal the parent's width. A floatedelement's width will default to auto, whichthen defaults to zero, which is then increased to the browser'sminimum allowed width. Thus, a floated paragraph could literally be

Figure 11-22

Figure 11-22. A drop cap

There's an easy way to do this, and that is of course to usethe :first-letter pseudo-element. The style wouldlook something like this:

P.intro:first-letter {font-size: 300%; font-weight: bold; float: left;width: 1em;}

This will result in approximately what is seen in Figure 11-22.

programming, but a common value is 2 or 3 pixels.

8.2.2. Horizontal Formatting

In contrastto vertical formatting, horizontal formatting can get a littlecomplicated. Fortunately, it starts out simply enough; it'sonly when you start putting things together that the situation