<P><LINE>This is a paragraph with a number of</LINE><LINE>lines of text which make up the</LINE><LINE>contents.</LINE></P>

Even though the LINE tags don't exist, thesituation is the same as if they did. Each line of text inheritsstyles from the paragraph, so they may as well be contained withintags such as these. Therefore, the only reason we createline-height rules for block-level elements is so Sunday 04th of December 2016 11:24:05 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
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. Adjacent-sibling selector

If you thought that was interesting, consider our next subject: the adjacent sibling selector. This is in some ways like the child selector, but in this case, styles are applied to elements that share a parent and are next to each other in the document tree. For example:

H2 + P {color: silver;}a padding for the paragraph that is wide enough to accommodate thepositioned element. Also, since it has a transparent background, theparent element's text shows through the positioned element. Theonly way to avoid this is to set a background for the positionedelement.

Note that the boldface element in this case is positioned in relationto its parent element's content box, which defines itscontaining block. Without the relative positioning of the parentelement, the containing block would be another element. Consider a