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
https://forums.phpfreaks.com/topic/24570-nested-lists/
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
https://forums.phpfreaks.com/topic/24570-nested-lists/#findComment-111965
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
https://forums.phpfreaks.com/topic/24570-nested-lists/#findComment-111976
Share on other sites

Archived

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

×
×
  • 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.