by Eric A. Meyer
First edition, published May 2000.
(See the catalog page for this book.)
Search the text of Cascading Style Sheets: The Definitive Guide.
This may be an interesting effect, but it isn't permissible under the CSS specification, and no other browser will do the same thing, so it's best to avoid this altogether.
Even worse, if you try applying padding to inline elements in
Appendix B: HTML 2.0 Style Sheet
Appendix C: CSS1 Properties
Appendix D: CSS Support Chart
Copyright © 2002 O'Reilly & Associates. All rights reserved.probably fairly safe, but trying to push an element upward on the page is a generally bad idea.
There is one other way for a floated element to exceed its parent's inner left and right edges, and that's when the floated element is wider than its parent. In that case, the floated element will simply overrun the right or left inner edge -- depending on which way the element is floated -- in its best attempt to display itself correctly. This will lead to a result liketo a point below any previous floats, as illustrated by Figure 8-36 (where the floats start on the next line inorder to more clearly illustrate the principle at work here). Thisrule first appeared in CSS2, to correct its omission in CSS1.
8. A floating element must be placed as high aspossible.
Subject to the restrictions introduced by the previous seven rules,of course. Historically, browsers aligned the top of a floated