[whatwg] <p> elements containing other block-level elements

Ian Hickson wrote:
> One thing that XHTML2 does which makes a lot of sense to me is allow 
> nesting of certain elements within <p> elements, as in:
> 
>    <p>
>     For this recipe you need
>     <ul>
>      <li>an egg,</li>
>      <li>flour, and</li>
>      <li>butter.</li>
>     </ul>
>     Mix it all together and so forth.
>    </p>

The problem is that you mix inline with block-level. Unless UL is 
redefined to be inline level within P I don't think this is a good idea. 
I like the idea of having either inline or block-level content.


> Other elements that I could see being nested inside a paragraph are:
> 
>   * <ol>
>   * <ul>
>   * <dl>
>   * <menu>
>   * <table>

I can agree with these, although I wonder about MENU.


>   * <pre> 

We have CODE and other nice inline elements for this.


> I think the following should be allowed:
> 
>   <p>
>    ...
>    <table>
>     <tr>
>      <td>
>       <p>...</p>
>      </td>
>     </tr>
>    </table>
>   </p>

That is indirectly nesting P elements, a bit ugly IMHO. It also doesn't 
make sense.


>   <p>
>    ...
>    <ol>
>     <li>...</li>
>    </ol>
>   </p>

If OL is an inline element here, sure.


>   <ol>
>    <li>
>     <p>
>      ...
>      <ol>
>       <li>
>        ...

Why would you want a P element there?


>   <pre>
>    <p>...</p>
>    <p>...</p>
>   </pre>

Ouch! Forbid this.


>   <p>
>    ...
>    <pre>...</pre>
>   </p>

Use case?


> I think the following should not:

Agreed with all examples.


-- 
  Anne van Kesteren
  <http://annevankesteren.nl/>

Received on Thursday, 7 April 2005 00:13:11 UTC