Welcome to WebmasterWorld Guest from 50.16.31.61

Forum Moderators: incrediBILL

Labeling Lists

   
4:07 pm on Apr 25, 2012 (gmt 0)

5+ Year Member Top Contributors Of The Month



I'm trying to use proper markup with my code. Currently I have a list of different fruits with a header:

<h2>Fruit</h2>
<ul>
<li>Apple</li>
<li>Lemon</li>
<li>Watermelon</li>
</ul>


I was looking if there was a more appropriate way to label my lists, and I came across a label header:

<ul>
<lh>Fruit</lh>
<li>Apple</li>
<li>Lemon</li>
<li>Watermelon</li>
</ul>


Unfortunately the label header is no longer valid. Is it appropriate to use a definition list (it seems some people use it this way, but it troubles me because an "apple" is not the definition of a "fruit"), or is the way I am currently doing it the best method?

<dl>
<dt>Fruit</dt>
<dd>Apple</dd>
<dd>Lemon</dd>
<dd>Watermelon</dd>
</dl>
5:48 am on May 14, 2012 (gmt 0)



Hi,
From what i saw in the code of some CMS, they use <dl><dt><dd> for lists with specified header /label.
Or, another method:

<ul>
<li>Fruit
<ul>
<li>Apple</li>
<li>Lemon</li>
<li>Watermelon</li>
</ul>
</li></ul>

But maybe that isn't so important if you create the page as you want.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month