HTML & CSS
I used to think that all block-level elements can contain block elements & inline elements.
In [reference.sitepoint.com/html/h1, [URL="http://reference.sitepoint.com/html/h6"]reference.sitepoint.com/html/h6 , [URL="http://reference.sitepoint.com/html/p"]reference.sitepoint.com/html/p](http://reference.sitepoint.com/html/h1) etc. it's mentioned:
This element may contain any text content, but it can’t include any block-level elements: only inline or phrase elements can be included.
When I checked, I saw that <h1>, <h2>....<h6>, <p>, <li> inside <dir> or <menu> cannot contain block-level elements.
Are there any other block elements that cannot contain block elements?
dt is another one I can think of.
is not validating
Note that it can’t contain any block-level elements—not even p or heading elements such as h1, h2, and so on. It can only contain text.
The answer to the question partially depends upon whether you are using either: Strict or Transitional HTML 4.01 markup?
Since it actually differs on what is allowed within a block-level element itself.
Thus assuming Strict others may include: ADDRESS, FIELDSET, PRE there are other deprecated tag examples and some that obviously follow 'specific rules' e.g. like UL having a LI but I won't bother with those, etc. Maleika already covered definition lists and you spotted some others at that SP refrence too.
I'm concerned about Strict mode.
Where to find more details? Sitepoint's reference on ADDRESS, FIELDSET, PRE doesn't mention anything about this.
Where do you get such info?
From the horse's mouth: http://www.w3.org/TR/html401 rather than a book it's explained in the W3C TR http://www.w3.org/TR/html401/index/elements.html even though its not light reading.
This topic is now closed. New replies are no longer allowed.