SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    Floridiot joebert's Avatar
    Join Date
    Mar 2004
    Location
    Kenneth City, FL
    Posts
    823
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Multiple <dt>/<dd> pairs on one <dl> ?

    I'm not sure if the context of a <dl> applies to a list of terms and definitions for a single subject, or a single word and its' aliases.

    Which one should I use ?

    Code:
    <dl>
    	<dt></dt>
    	<dd></dd>
    	
    	<dt></dt>
    	<dt></dt>
    	<dd></dd>
    </dl>
    Code:
    <dl>
    	<dt></dt>
    	<dd></dd>
    </dl>
    
    <dl>
    	<dt></dt>
    	<dt></dt>
    	<dd></dd>
    </dl>

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,215
    Mentioned
    58 Post(s)
    Tagged
    3 Thread(s)
    if they are parts of different lists, use the second one

    if they are parts of the same list, use the first one

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    Floridiot joebert's Avatar
    Join Date
    Mar 2004
    Location
    Kenneth City, FL
    Posts
    823
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I do like the first one.

    In this case I'm listing device specs, and I'm leaning towards the following format at the moment.

    Code:
    <h1>Device Specs</h1>
    
    <h2>Display Specs</h2>
    <dl>
    	<dt>Width</dt>
    	<dd>1234 <abbr title="Pixels">px</abbr></dd>
    	
    	<dt>Height</dt>
    	<dd>1234 <abbr title="Pixels">px</abbr></dd>
    </dl>
    
    <h2>Audio Specs</h2>
    <dl>
    	<dt>Frequency Response</dt>
    	<dd>20Hz to 20,000Hz</dd>
    </dl>
    For instance, I wasn't sure if width/height would need to be in their own <dl> elements.

  4. #4
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,215
    Mentioned
    58 Post(s)
    Tagged
    3 Thread(s)
    that looks okay to me -- i mean, semantically
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  5. #5
    Floridiot joebert's Avatar
    Join Date
    Mar 2004
    Location
    Kenneth City, FL
    Posts
    823
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the input.
    Semantics are my main concern at the moment.

  6. #6
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A dl is a definition list, which means it should normally contain multiple items. Each item consists of at least one dt followed by at least one dd.

    Your second option, with just a single item in each list, is a special case: a degenerated list. It's not always wrong, but the norm for a list is to contain more than one item.
    Birnam wood is come to Dunsinane


Bookmarks

Posting Permissions

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