[thelist] Guru help needed, LI and P

Techwatcher techwatcher at accesswriters.com
Fri Jun 14 12:54:01 CDT 2002


Hi, some expert --

Along with my learn-CSS project I am necessarily doing a review-HTML-
4.0 project (although I actually use the XHTML transitional DTD; the
XHTML spec refers to the HTML spec, plus changes... annoying, that.).
Now I have a major question:

The P element (necessarily including start and end tag for XML, and so
also for XHTML) cannot [NOT] include a block-level element. UL is, of
course, a block-level element. (As far as I know, the technical
definition of a block-level element is that it creates a line-feed/cr.)

I had previously assumed I could put lists inside paragraphs, and
paragraphs inside lists. Now I know better. I can't put lists inside
paragraphs.

But can I still put paragraphs inside the LI (list item)? I have been
doing this a lot. I also don't know yet what I might do if P within LI
turns out to be invalid, according to the spec!

The LI forces a line-feed, thus it might be a block-level element. But
I can't find anything in this element's definition that says it can or
cannot contain another block-level element (whereas the definition of P
explicitly forbids this).

I wish the spec would be explicit in all cases about what I can and
cannot include within an element, or what can include an element.
Grumble, grumble, grumble....



Cheers
Carol Stein
techwatcher at accesswriters.com



More information about the thelist mailing list