I'm trying to make sense of the CSS float property, and I understand the basic motivation of text flowing around a floated image. My question is this: since inline elements flow around floated elements, even if if those inline elements are children of non-floated block-level elements, can we somehow consider the text inside the paragraph element to be inline? I'm trying to form a good mental model of what is happening. Thanks.
Asked
Active
Viewed 282 times
2 Answers
3
From the CSS spec:
Any text that is directly contained inside a block container element (not inside an inline element) must be treated as an anonymous inline element.
So it's an inline box generated by a block element as opposed to an inline box generated by an inline element. Anonymous only means that it doesn't have an associated inline element.

melhosseiny
- 9,992
- 6
- 31
- 48
0
<p>
is a block element.
<p>
cannot enclose other block elements.
Text inside of <p>
is inline by default.

Vin Burgh
- 1,399
- 1
- 8
- 14
is an exception to the rule; it's a block element that was never designed nor intended to act as a container for other block elements.
– Vin Burgh Feb 01 '12 at 22:41