468,110 Members | 1,562 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,110 developers. It's quick & easy.

How to construct XHTML-compliant nested list?

How do I construct an XHTML-compliant nested unordered list?

This displays correctly (both FF and IE):

<ul>
<li>list item</li>
<li>list item</li>
<li>list item</li>
<ul>
<li>nested list item</li>
<li>nested list item</li>
<li>nested list item</li>
</ul>
</ul>

But fails validation with this error:

document type does not allow element "ul" here; assuming missing "li" start-tag.

How can I nest a list if I can't put a <ulwithin a <ul??

Thanks in advance.

Aug 25 '06 #1
6 15103
de**@nospam.com says...
How do I construct an XHTML-compliant nested unordered list?

This displays correctly (both FF and IE):

<ul>
<li>list item</li>
<li>list item</li>
<li>list item</li>
<ul>
<li>nested list item</li>
<li>nested list item</li>
<li>nested list item</li>
</ul>
</ul>

But fails validation with this error:

document type does not allow element "ul" here; assuming missing "li" start-tag.
Logically the nested list is a child of the third list item and should be
wholly contained within it.

<ul>
<li>list item</li>
<li>list item</li>
<li>list item
<ul>
<li>nested list item</li>
<li>nested list item</li>
<li>nested list item</li>
</ul>
</li>
</ul>

If it's not logically a child of that element, don't nest it. Use
blockquote if you simply want it indented further.

Geoff M
Aug 25 '06 #2
<ul>
<li>list item</li>
<li>list item</li>
<li>list item
<ul>
<li>nested list item</li>
<li>nested list item</li>
<li>nested list item</li>
</ul>
</li>
</ul>
That did the trick. Thanks!
Aug 25 '06 #3
Geoff Muldoon wrote:
Use blockquote if you simply want it indented further.
You give good advice about proper nesting of lists and then suggest
using blockquote for indenting. You're joking, right?

Steve

Aug 25 '06 #4
Geoff Muldoon wrote:
If it's not logically a child of that element, don't nest it. Use
blockquote if you simply want it indented further.
<blockquoteis for marking up .. well .. quotes. Not as an indenting
tool.

I have several quotes on this page, for example.
http://www.freezeblock.com/homeowner.php

--
-bts
-Motorcycles defy gravity; cars just suck.
Aug 25 '06 #5
deko wrote:
How do I construct an XHTML-compliant nested unordered list?
I just answered a similar post for Luigi (a character actor who plays
roles occasionally in alt.html). He wanted to know about ordered lists,
but the markup is the same, except for the "o" or the "u".

http://k75s.home.att.net/tests.html

--
-bts
-Motorcycles defy gravity; cars just suck.
Aug 25 '06 #6
Steve Pugh <st**********@gmail.comscripsit:
Geoff Muldoon wrote:
>Use blockquote if you simply want it indented further.

You give good advice about proper nesting of lists and then suggest
using blockquote for indenting. You're joking, right?
Wasn't that obvious?

I guess we need <blockjokemarkup, the meaning of which is random
indentation and a background consisting of smileys. It should have an
optional trolling="trolling" attribute.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Aug 25 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

59 posts views Thread by Philipp Lenssen | last post: by
82 posts views Thread by Buford Early | last post: by
2 posts views Thread by Joris Janssens | last post: by
11 posts views Thread by Tomek Toczyski | last post: by
22 posts views Thread by Gianni Rondinini | last post: by
30 posts views Thread by abracad_1999 | last post: by
11 posts views Thread by Kidogg | last post: by
27 posts views Thread by pamela fluente | last post: by
10 posts views Thread by Robert Huff | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.