Jump to content

Archived

This topic is now archived and is closed to further replies.

Ninjakreborn

nested lists

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?

Share this post


Link to post
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 ;)

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

×

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.