Welcome to WebmasterWorld Guest from 54.167.40.25

Forum Moderators: incrediBILL

Message Too Old, No Replies

Labeling Lists

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

Full Member

5+ Year Member Top Contributors Of The Month

joined:Sept 30, 2009
posts:222
votes: 0


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)

New User

joined:May 13, 2012
posts:20
votes: 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.