Wednesday 21st of February 2018 12:21:35 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
auto ? The answer is simple: both margins are setto zero, and the width is made as wide aspossible. This result is the same as the default situation when thereare no values explicitly declared for margins or the width. In such acase, the margins default to zero (0) and thewidth defaults to auto. This is illustrated inFigure 8-17.

Figure 8-17

Figure 8-17. Everything set to auto

Note that since horizontal margins do not collapse, the padding, 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

Library Navigation Links

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

of text has been indented -40px.

Figure 4-6

Figure 4-6. Negative indents and floating images

Any unit of length may be used with text-indent.In addition, percentage values are allowed. In this case, thepercentage refers to the width of the parent element being indented.Thus, if you set the indent value to 5%, the firstline of an affected element will be indented by 5% of the parentelement's width, as shown in Figure 4-7:

For those of you concerned about making your documents accessible to older browsers, there is an important warning to be made. You're probably aware that browsers ignore tags they don't recognize; for example, if a web page contains a BLOOPER tag, browsers will completely ignore the tag because it isn't a tag they recognize.

blank spaces between them.  A better alternative is to do multi-imagelayouts in tables (see separate chapter).

Pay attention to the file sizes of your images!  Web-surfersare often impatient, and may not wait for large images to load.  Youcan keep your visitors' attention with interleaved GIFs and progressiveJPEG's, which appear quickly at coarse resolution and gradually sharpen,or you can referrence a small, low-resolution version of your image inthe <IMG> tag, e.g. <IMG WIDTH=200 HEIGHT=150 SRC="hi_res.gif"LOWSRC="low_res.gif"> 

Another option is to include a small "thumbnail" version of the

The small box B in the lower-left corner of the element A is a child of A, which is in turn a child of a relatively positioned DIV. B was absolutely positioned, as was element A, using styles like these:

DIV {position: relative;}
P.A {position: absolute; top: 0; right: 0; width: 15em; height: auto;
margin-left: auto;}
P.B {position: absolute; bottom: 0; left: 0; width: 10em; height: 50%;
margin-top: auto;}
Figure 8-31

Figure 8-31. Keeping floats from overlapping

The advantage of this rule is that, since you don't have to worry about one floated element obscuring another, you can be assured that all of your floated content will be visible. This makes floating a fairly safe thing to do. The situation is markedly different when using positioning, where it is very easy to cause elements to overwrite one another.

3. The right outer edge of a left-floating element may not be to the right of the left outer edge of any right-floating element