<h1> within <p>

I did something like this in my html:

   <p>
   <h1>foo</h1>
   </p>

and the validator complains as follows:

   Error: end tag for element "P" which is not open; try removing the
   end tag or check for improper nesting of elements

This, of course, validates cleanly:

   <p>
   foo
   </p>

If <h1> is allowed within <p>, there's a bug in the validator.

If <h1> is not allowed within <p>, then shouldn't the validator say so 
(when it encounters the <h1>) rather than silently ending the <p> and 
leaving the user to wonder what happened? If I were an HTML guru, I 
probably wouldn't need to bother with the validator. It took me quite a 
while to boil it down to a few tags and figure out what it was 
complaining about.


- Richard

Received on Thursday, 18 July 2002 12:44:06 UTC