If the
floated element is within a line box, the top of the floated box is aligned with the
top of the line box. If there isn??™t enough horizontal room left for non-floated content
to flow alongside the floated box on the current line, it??™s shifted down until it fits,
or there are no more floated elements.
Defining the Margin Edge
The margin edge of a box surrounds the margin of the box. If the box has no margins,
the margin edge is the same as the border edge. See The CSS Box Model (p. 142) for
more information.
A floated box is taken out of the flow, so it doesn??™t affect the block-level boxes
around it. Line boxes located next to a floated box, however, are shortened to make
room for the float. A containing block will not expand to accommodate a floating
child box, unless the containing block is also floating, or has its overflow property
set to something other than visible.28
27 Contrary to what some may think (or wish for), float does not support the value center.
28 In Internet Explorer 6 and prior versions, the overflow property does not cause the containing
block to expand as described here.
Pages:
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277