Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Feb 2009
    Posts
    78
    Thanks
    19
    Thanked 1 Time in 1 Post

    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.

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,861
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    <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/
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    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
    Last edited by bazz; 01-14-2010 at 12:43 PM.
    "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

  • #4
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,376
    Thanks
    11
    Thanked 592 Times in 572 Posts
    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 13/9/26)
    BROWSER STATS [% share] (2014/9/03) IE7:0.1, IE8:4.6, IE11:9.1, IE9:3.1, IE10:3.0, FF:17.2, CH:46, SF:11.4, NON-MOUSE:38%

  • #5
    Regular Coder
    Join Date
    Nov 2009
    Posts
    110
    Thanks
    7
    Thanked 9 Times in 9 Posts
    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.

  • #6
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    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,

    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

  • #7
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •