Monday 04th of May 2015 02:56:55 AM

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
element. With the right styles, the containing block for thepositioned element will be the entire BODYelement. Thus, applying the following styles to theBODY and the fifth paragraph in a document wouldlead to a situation similar to that shown in Figure 9-20:

BODY {position: relative;}<P STYLE="position: absolute; top: 0; right: 25%; left: 25%; bottom: auto;width: 50%; height: auto; background: silver;">...</P>
Figure 9-20

Figure 9-20. An absolutely positioned paragraph

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
Colophon
Library Navigation Links

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

The other possibility is when one of the margins and the width areset to be auto. In this case, then the margin setto be auto is reduced to zero:

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

The width is then set to the value necessary toreach the required total, as demonstrated in Figure 8-16.

Figure 8-16

Figure 8-16. Setting an explicit right margin

Finally, what happens when all three properties are set to