Saturday 27th of August 2016 10:05:57 AM

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.

H2, so it is silver. In the second, the elementadjacent to the H2 is a UL,which does not match the rule, and neither does the paragraph rightafter that. Finally, even though there is text directly after thethird H2, it isn't part of an element, sothe paragraph right after the text matches the rule and is coloredsilver. All this is demonstrated in Figure 10-5.

Figure 10-5

Figure 10-5. Selecting adjacent elements

If you wanted to make any element immediately following an it would have been if the element had not been positioned. Forexample, consider a nonpositioned element whose top edge is 3 emsfrom the top of its containing block. If the element is thenpositioned and given a top ofstatic-position, then the top of the positionedelement will be 3 ems from the top of the containing block. Later inthe chapter, we'll see how this can be useful.

The other value, auto, allows for some even moreinteresting effects. It acts much the same as setting

DIV {width: 400px; border: 1px solid black;}P.wide {margin-left: -50px; width: auto; margin-right: 10px;border: 3px solid gray;}
Figure 8-20

Figure 8-20. Setting a negative left margin

In this case, not only does the paragraph spill beyond the borders ofthe DIV, but also beyond the edge of the browserwindow itself!

TIP

recognize the file as containing a style sheet unless it actuallyends with .css, even if youdo include the correct TYPEof text/css in the LINKelement. So make sure you name your style sheets appropriately.

1.4.1.1. LINK attributes

For the rest of the LINK

As Figure 7-58 demonstrates, the background of an element extends into the padding. As we discussed before, it also extends to the outer edge of the border, but the background has to go through the padding before it even gets to the border.

The default value of padding is 0 (zero), and padding values cannot be negative.

WARNING