9.21
Figure 6.9: An anonymous block box
An anonymous block box inherits its properties from the enclosing non-anonymous
box??”the div box in this example. Any non-inherited properties are set to their
initial (default) values.
The principal box becomes the containing block (p. 147) for non-positioned
descendant boxes, and it??™s also the box that??™s affected for any value of position
other than static, and for any value of float other than none.
In a block formatting context the vertical distance between two sibling boxes is
determined by their respective margin properties; vertical margins between adjacent
block boxes collapse if there are no borders or padding in the way. For more
information, see Collapsing Margins (p. 148).
In a left-to-right environment, the left outer edge of each block box touches the left
edge of the containing block. In a right-to-left environment, the right edges touch.
This happens even if there are floated elements in the way, except if the block box
21 Note that mixing block and inline content like this is semantically questionable, and it??™s not
something we recommend.
Pages:
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253