tags:

views:

63

answers:

2

Is this the right way to do a nested navigation?

 <dl>
  <dt>Struktur</dt>
  <dd>
   <ul id="structure">
 <li><a href="/module/structure/add">Hinzufügen</a></li>
 <li><a href="/module/structure/index">Auflisten</a></li>
   </ul>
  </dd>

  <dt>Nachrichten</dt>
  <dd>
   <ul id="messages">
 <li><a href="/module/messages/add">Schreiben</a></li>
 <li><a href="/module/messages/directory">Ordner</a></li>
 <li><a href="/module/messages/index">Auflisten</a></li>
   </ul>
  </dd>
  </dl>
+5  A: 

I agree with n1313, it really depends what you mean by "right way".

If you do want a nit-picky answer: Strictly speaking, "Hinzufügen" and "Auflisten" are not the definition of "Struktur", so using a <dl> list to structure those elements is probably not The Right Way™. A simple nested <ul> list might be better.

<ul>
    <li>
        <div class="parent">Struktur</div>
        <ul>
            <li>
                ...
deceze
Yeah, I agree with this answer.A unordered list, is the most common way of creating a menu.
Kim Andersen
Thanks, thats what i asked :)
codedevour
A: 

semantically, i dont think using a dt tag is correct. use a h2 or h3 tag instead.

<h2>Nachrichten</h2>
<ul id="messages">
    <li><a href="/module/messages/add">Schreiben</a></li>
    <li><a href="/module/messages/directory">Ordner</a></li>
    <li><a href="/module/messages/index">Auflisten</a></li>
</ul>

looking at your code, it doesnt seem like you're nesting any of the ul/li items, but the method deceze posted for doing so is correct:

<ul>
   <li>Item 1</li>
   <li>Item 2
      <ul>
         <li>subitem</li>
         <li>subitem 2</li>
      </ul>
   </li>
</ul>
marauder