Forum Moderators: open

Message Too Old, No Replies

xhtml validation and nested lists

         

Robber

1:00 pm on Oct 8, 2002 (gmt 0)

10+ Year Member



Just working on site validation and this seems to be causing a problem, when I close the li tag it gives one error but it cant be left open because of the well formed constraint. I cant use an empty element because then my text is not part of the li tag.

Anyone else done this?

andreasfriedrich

1:08 pm on Oct 8, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The following example validates (XHTML 1.0 Strict) just fine.

<ul> 
<li>one</li>
<li>two
<ul>
<li>two.one</li>
</ul>
</li>
</ul>

Make sure that elements nest properly.

Andreas

Robber

1:25 pm on Oct 8, 2002 (gmt 0)

10+ Year Member



Hi andrea,

Thanks for that, I thought you'd made a mis-spell first time I glanced at that - thought you hadnt closed the li tag, but then I took a closer look and that makes perfect sense. I just hadnt got my brain into gear on how the list was actually being built - didnt realise the nested ul was actually a part of the previous li.

Cheers