Thursday 31st of July 2014 05:19:47 AM

Finally, the default border color is the foreground color of theelement itself. If no color has been declared for the border, then itwill be the same color as the text of the element. If, on the otherhand, an element has no text -- let's say a table whichcontains only images -- then thanks to the fact that color isinherited, the border color for that table would be the text color of alt="Book Home" >

Cascading Style Sheets: The Definitive GuideSearch this book

Symbols | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z

Index: E

element boxes: 7.1. Basic Element Boxes
8.1. Basic Boxes
element clipping: 9.1.4.3. Element clipping
element selectors: 2.1.1. Rule Structure
elements
classification of: 2.9. Classification of Elements
floated (see floated elements)
overlapping, altering: 9.5. Stacking Positioned Elements
styling common: 11.2.4. Styling Common Elements
visibility of: 9.1.5. Element Visibility
elevation property: 10.8.2. The Spoken Word
em box: 5.3. Font Size
em-height (em): 3.2.2.1. em and ex units
em length value: 5.3.3. Percentages and Sizes
em square: 5.3. Font Size
embedded style sheets: 1.4.2. The STYLE Element
ex-height (ex): 3.2.2.1. em and ex units
Extensible Markup Language (see XML)
external style sheets: 1.4.1. The LINK Tag
creating: 11.1.1. Case 1: Consistent Look and Feel
loading
with @import directive: 1.4.3. The @import Directive
with LINK element: 1.4.1. The LINK Tag
extra space around elements, adding: 7.2. Margins or Padding?
7.2. Margins or Padding?
(see also margins)


Symbols | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z


Library Navigation Links

Copyright © 2002 O'Reilly & Associates, Inc. All Rights Reserved.

the minimum height for each line box is 24 points. Technically, the only way content will inherit this line height is if it is inherited by an inline element. Most text isn't contained by an inline element. Thus, if we pretend that each line is contained by the fictional LINE element, then the model works out very nicely.

8.4.2.1. Generating a line box

The second rule overrides the width value for the left border assigned by the first rule, thus replacing thick with 20px , as we see in Figure 7-50.

A lot of this story will sound pretty familiar because it's largely the same as what we discussed with margins and inline elements.

In the first place, no matter how thick you make your borders on inline elements, the line-height of the element won't change.

Nothing unusual there, of course, but Figure 8-40shows what happens when we set the first paragraph to have abackground.

Figure 8-40

Figure 8-40. Backgrounds and floated elements

There is nothing different about the second example, except for thevisible background. As you can see, the floated image sticks out ofthe bottom of its parent element. Of course, it did so in the firstexample, but it was less obvious there, because we couldn't seethe background. There is nothing forbidden about this behavior. The

A related topic is the subject of backgrounds and their relationship to floated elements that occur earlier in the document, which was also discussed in the previous chapter, as has been illustrated in Figure 8-41.

Figure 8-41

Figure 8-41. Backgrounds "slide under" floated elements

Because the floated element is both within and without the flow, this sort of thing is bound to happen. What's going on? Well, the content of the paragraphs is being "displaced" by the