Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-14-2010, 08:09 AM   PM User | #1
zoe20
New Coder

 
Join Date: Feb 2009
Posts: 78
Thanks: 19
Thanked 1 Time in 1 Post
zoe20 is an unknown quantity at this point
Thumbs up Whats the diff. Between dl,dd,dt and ul li

hi friends i saw a new element in html dl,dl,dd and i would like to know whats these are when to used them an whats the difference between ul li to dl dd, dt please . please explain me with examples please.
zoe20 is offline   Reply With Quote
Old 01-14-2010, 08:48 AM   PM User | #2
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,678
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
<ul> - <li> tags are for making an unordered list, in which the individual list items might not have any relationships among, except they fall under a group. But, <dl> is for making a definition list, where we can have a definition title inside <dt> and one or more definition description, for the above title, inside <dd> tags.
Se the examples at http://www.htmldog.com/reference/htmltags/ul/ and http://htmldog.com/reference/htmltags/dl/
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 01-14-2010, 09:08 AM   PM User | #3
bazz
Master Coder

 
Join Date: Apr 2003
Location: in my house
Posts: 5,211
Thanks: 39
Thanked 201 Times in 197 Posts
bazz will become famous soon enoughbazz will become famous soon enough
I just had a thought which may help you (or others), now and later, both in terms of time and computing experience...

an unordered list is like this
Code:
<ul>
  <li>list item 1</li>
  <li>list item 2</li>
</ul>
an ordered list is like this

Code:
<ol>
  <li>list item 1</li>
  <li>list item 2</li>
</ol>
and a definition list (dl) is like this

Code:
<dl>
  <dt>WORD</dt>
    <dd>Meaning</dd>
  <dt>DEFINITION</dt>
    <dd>If I knew what this word meant, I would place the definition here.</dd>
</dl>
The idea I had was that a list (the first two), are just plain old lists. The last one - the definition list (dl) is an associative list where the <dd> tags are associated with the <dt> tag.

Later in your programming - if you do some - you will hear about arrays(lists) and associative arrays (also known as hashes[in Perl]). These dl and ul are a pretty good visual of arrays and hashes and this might go some way in helping poeple to understand them better/more easily, sooner.

bazz
__________________
"The day you stop learning is the day you become obsolete"! - my late Dad.

Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
Useful MySQL resource
Useful MySQL link

Last edited by bazz; 01-14-2010 at 12:43 PM..
bazz is offline   Reply With Quote
Old 01-15-2010, 02:34 AM   PM User | #4
rnd me
Senior Coder

 
rnd me's Avatar
 
Join Date: Jun 2007
Location: Urbana
Posts: 3,452
Thanks: 9
Thanked 466 Times in 450 Posts
rnd me is a jewel in the roughrnd me is a jewel in the roughrnd me is a jewel in the rough
they don't have to be used for definitions.
they are a list of key:value pairs, like fieldset /legend met a list.

i use them extensively for all kinds of things.
a typical example would be as news items on a front page:

Code:
<dl class="events">
 <dt>item title</dt>
 <dd>item text goes here</dd>
</dl>
__________________
my site (updated 5/13)
STATS (2013/5) HTML5:90.2% MOB:14% IE7:0.5% IE8:8.8% IE9:11.4% IE10:6.5%
rnd me is offline   Reply With Quote
Old 01-15-2010, 04:19 AM   PM User | #5
linehand
Regular Coder

 
Join Date: Nov 2009
Posts: 110
Thanks: 7
Thanked 9 Times in 9 Posts
linehand can only hope to improve
Supported in all major browsers too. Right? I mean technically this should be the case but are there any caveats? "Supported" does not necessarily mean they all handle it in exactly the same manner.
linehand is offline   Reply With Quote
Old 01-15-2010, 05:48 AM   PM User | #6
oesxyl
Master Coder


 
Join Date: Dec 2007
Posts: 6,682
Thanks: 436
Thanked 890 Times in 879 Posts
oesxyl is a jewel in the roughoesxyl is a jewel in the roughoesxyl is a jewel in the rough
Quote:
Originally Posted by rnd me View Post
they don't have to be used for definitions.
they are a list of key:value pairs, like fieldset /legend met a list.
this in my opinion is a procedural point of view,

Quote:
i use them extensively for all kinds of things.
a typical example would be as news items on a front page:

Code:
<dl class="events">
 <dt>item title</dt>
 <dd>item text goes here</dd>
</dl>
in my opinion this looks more like a div + h1-6 + p structure then a list of definition, glossar of terms and so on,.
the content decide what it is and if you use "item title" no mater how short is "item text goes here" look like a paragraph with a title.

best regards
oesxyl is offline   Reply With Quote
Old 01-15-2010, 05:52 AM   PM User | #7
oesxyl
Master Coder


 
Join Date: Dec 2007
Posts: 6,682
Thanks: 436
Thanked 890 Times in 879 Posts
oesxyl is a jewel in the roughoesxyl is a jewel in the roughoesxyl is a jewel in the rough
Quote:
Originally Posted by linehand View Post
Supported in all major browsers too. Right? I mean technically this should be the case but are there any caveats? "Supported" does not necessarily mean they all handle it in exactly the same manner.
http://reference.sitepoint.com/html/elements-list

follow the links for each tag and you will find who support what,

it's more or less a opinion but I agree more with abduraooft point of view about this tags.

best regards
oesxyl is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:28 PM.


Advertisement
Log in to turn off these ads.