
Originally Posted by
Percept
Are there any advantages to use <dl> instead of <ul> for link lists that I'm not awear of ?
With a definition list (dl) you get a parent child relation ship between the title (dt) and the data (dd). This is a back-to-front way of looking at headers.
You might make the title an <h4> or something, and then have the contents in a <p>. Here, the header is "the most important" part.
In our menu, the title, "links", isn't as important as the links themselves. This means that we could describe the links as "defining" the title, in which case the definition list structure would make the most sense.
The HTML alos looks better, because the titles are inside the same containing element:
Code:
<div id="nav">
<h4>Title</h4>
<ul>
<li><a>Link</a></li>
</ul>
</div>
or
Code:
<dl id="nav">
<dt>Title</dt>
<dd><a>Link</a></dd>
</dl>
I like the second more. It is more compact.
Finally, this style rule will make a <dd> look just like an <li>:
Code:
dl, dt, dd, li, ul {
margin: 0;
padding: 0;
list-style: none;
}
It isn't all that much.
Regards,
Douglas
Bookmarks