Jump to content

nested lists


Ninjakreborn

Recommended Posts

I was wondering, with xhtml, I was trying to use nested lists, to get a different affect.
Like
[code]<ul>
<li>Master Category</li>
  <ul>
  <li>Sub 1</li>
  <li>Sub 2</li>
  <li>Sub 3</li>
  </ul>
<li>Master Category 2</li>
  <ul>
  <li>Sub 1</li>
  <li>Sub 2</li>
  <li>Sub 3</li>
  <li>Sub 4</li>
  </ul>
<li>Master Category 3</li>
  <ul>
  <li>Sub 1</li>
  <li>Sub 2</li>
  </ul>
</ul>[/code]
When I do this however I get validation errors, but this is a good way to make it seem like i have category subcategory setup, why the validation errors?
Link to comment
Share on other sites

try placing your internal <ul> tags within your <li>:
[code]
<ul>
  <li>Master Category 3
    <ul>
      <li>Sub 1</li>
      <li>Sub 2</li>
    </ul>
  </li>
</ul>
[/code]
to be perfectly honest, i don't know if it will help validation since i don't have a good way to check right this minute, but try it and see ;)
Link to comment
Share on other sites

[quote author=obsidian link=topic=112148.msg455078#msg455078 date=1161366199]
try placing your internal <ul> tags within your <li>:
[code]
<ul>
  <li>Master Category 3
    <ul>
      <li>Sub 1</li>
      <li>Sub 2</li>
    </ul>
  </li>
</ul>
[/code]
to be perfectly honest, i don't know if it will help validation since i don't have a good way to check right this minute, but try it and see ;)
[/quote]

Doing it this way should validate.  I use the same structure on my French site's flyout menus, and it validates as XHTML Strict.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.