Prev | Current Page 268 | Next

Tommy Olsson and Paul O'Brien

"The Ultimate CSS Reference"


Figure 6.16: A cleared element
To achieve this clearing, we add space above the cleared element??™s top margin until
it??™s clear of the affected floated boxes. As a result, we can??™t use the top margin on
the cleared element if we want a specific amount of space between it and the floated
box. Space is added above the cleared element??™s top margin until it??™s free of the
float, but that??™s all. If we want to create space beneath the floated box, we must set
the bottom margin of the floated element, or set top padding on the cleared element.
29 http://www.alistapart.com/articles/negativemargins/
183 CSS Layout and Formatting
Internet Explorer for Windows will automatically clear all floated children of an
element that has a layout, though this implementation disagrees with the CSS
specification.
See The Internet Explorer hasLayout Property (p. 158) for more information about
IE and layout.
Floating Versus Absolute Positioning for Multi-column Layouts
Floated boxes were intended to be used primarily for floating images so that text
would flow around them.


Pages:
256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280