Figure 4-6 shows one example, where the first lineof 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: Saturday 20th of January 2018 10:12:35 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
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.

transparent,which makes sense; if an element doesn't have a defined color,then its background should be transparent so that the background ofits ancestor elements will be visible. Imagine for a moment that thedefault value were something else, such as silver.Then you would always see something along the lines of Figure 6-16. This could be quite a problem, ifthat's how browsers behaved! Fortunately, they don't.

Figure 6-16

Figure 6-16. Nontransparent backgrounds

example, dotted and dashed styles -- and the element'sbackground should appear in the spaces between the visible portionsof the border.

Every border has three aspects: its width, or thickness; its style,or appearance; and its color. The default value for the width of aborder is medium , which is not explicitly definedbut usually works out to be two or three pixels. Despite this, thereason you don't usually see borders is that the default styleis none, which prevents them from existing. If a

11.2.5. Getting Full Content Backgrounds in Navigator

We coveredthis in Chapter 6, "Colors and Backgrounds", but it bears some repetition.We assume you want people using Navigator 4.x to see full backgroundcolors in text elements, not just behind the text. If you'veapplied a background color to a text element, add the followingdeclaration: border: 0.1pxsolid none. This will have novisual effect, but in the course of telling Navigator to draw a background. This can end up on both ends of the inline if we wish:

B {margin: 10px; background: silver;}

As expected, Figure 7-24 shows a little extra space on the right and left sides of the inline element, and no extra space above or below it.

Figure 7-24

Figure 7-24. An inline element with a 10-pixel margin

This all seems simple enough, but when the boldfaced text stretches across multiple lines, the situation becomes a little odd. First,the background color. In addition, if the image fails to load forsome reason, the user agent will use the background color specifiedin place of the image. Consider how the "starryparagraph" example would look if the background image failed toload, as in Figure 6-26.

Figure 6-26

Figure 6-26. The consequences of a missing background image

Given this reason alone, it's always a good idea to specify abackground color when using a background image, so that your whitetext will at least be visible: