Saturday 19th of May 2012 05:29:17 PM

by Eric A. Meyer
ISBN 1-56592-622-6
First edition, published May 2000.
(See the catalog page for this book.)

Search the text of Cascading Style Sheets: The Definitive Guide.

Table of Contents

Copyright Page
Preface
Chapter 1: HTML and CSS
Chapter 2: Selectors and Structure
Chapter 3: Units and Values
Chapter 4: Text Properties
Chapter 5: Fonts
Chapter 6: Colors and Backgrounds
Chapter 7: Boxes and Borders
Chapter 8: Visual Formatting
Chapter 9: Positioning
Chapter 10: CSS2: A Look Ahead
Chapter 11: CSS in Action
Appendix A: CSS Resources
Appendix B: HTML 2.0 Style Sheet
Appendix C: CSS1 Properties
Appendix D: CSS Support Chart
Index
"should" -- this is not a guarantee. It generallyseems to work, however.

Web-safe colors are those colors that are expressed in multiples ofthe RGB values 20% and 51, andthe corresponding hex-pair value 33. Also,0% or 0 is a safe value. So, ifyou use RGB percentages, then make all three values either0% or a number divisible by 20; for example,rgb(40%,100%,80%) or Colophon


Library Navigation Links

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

8.2.2.3. More than one auto

Now let us consider the cases where two of these three properties are set to auto. If both the margins are set to auto, then they are set to equal lengths, thus centering the element within its parent, as you can see from Figure 8-14:

P {width: 100px; margin-left: auto; margin-right: auto;}
Figure 8-14

Figure 8-14. Setting an explicit width

This is the correct way to center block-level elements, as a matter

8.2.1.2. Collapsing vertical margins

There is one other importantaspect of vertical formatting, which is the collapsing of adjacentmargins. This comes into play when an element with declared marginsimmediately follows another such element in the document'slayout. This was discussed in the previous chapter, using thisexample:

LI {margin-top: 10px; margin-bottom: 20px;}