View Single Post
Old 02-07-2016, 03:08 AM   #12
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,543
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by theducks View Post
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>
Jellby is offline   Reply With Quote