Stephan Beal wrote:
On Aug 6, 7:45 am, Klaus Hartl <[EMAIL PROTECTED]> wrote:
This is a typical case of running into unexpected results because of
invalid HTML. A p element must not contain a list. What happens here is
that a browser implicitly closes the paragraph before the list starts.
Is there a more general rule to follow than "no lists in a paragraph",
such as "no block-level elements in a paragraph"?
Yes. A paragraph may only contain inline-level elements.
<!ELEMENT P - O (%inline;)* -- paragraph -->
http://www.w3.org/TR/html401/struct/text.html#h-9.3.1
i'd never heard that certain elements aren't strictly allowed in a
paragraph (except in the HTML 5.0 draft, where block-level elements
won't be allowed inside of inline elements, if i'm not mistaken).
Inline-level elements must not contain bock-level elements, not only in
HTML 5, but also in HTML 4, XHTML 1, etc.
If in doubt, here's the HTML specification:
http://www.w3.org/TR/html401/
--Klaus