This example is provided just to illustrate how CSS handles the
situation.
CSS Layout and Formatting
The Ultimate CSS Reference 166
establishes a new block formatting context. In that case, the block box becomes
narrower to accommodate the floated elements.
Inline Formatting
Just as anonymous block boxes are sometimes created in a block formatting context,
anonymous inline boxes can be created when necessary. Here??™s an example of the
automatic creation of anonymous inline boxes:
In 1912, Titanic sank on her maiden voyage.
Since there??™s a child element??”the em element, which generates an inline box of its
own??”two anonymous inline boxes will be generated to contain the text nodes that
are immediate children of the p element, as shown in Figure 6.10.
Figure 6.10: Anonymous inline boxes
An anonymous inline box inherits its properties from its parent block box??”the p
element box in this example. Any non-inherited properties are set to their initial
values.
In an inline formatting context, boxes are laid out horizontally, starting at the top
of the containing block.
Pages:
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254