Quote:
Originally Posted by theducks
Div is a Block level and can not contain another block
|
That's not exact. <div> is a block-level tag and can contain block or inline level tags. If I remember correctly inline tags (like <span>) can contain block level tags too, and the "type" of any tag (at least to the extent of how they are rendered) can be changed with the CSS "display" property.
But <p> is a special case. It cannot contain block-level tags, not because it's block-level itself, but because it's <p> and it's defined that way. And the tags it cannot contain are those defined as block level by default, even if you change their "display". So this is forbidden:
Code:
<p><div>Foo</div></p>
But this is allowed and should have the same effect as intended:
Code:
<p><span style="display:block">Foo</span></p>