SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2010
    Posts
    83
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question definition lists

    I have a list of 5 products a definition list in the following structure:

    Product Name
    Price
    Description

    Each product name is a different colour. All prices are grey and all descriptions are black. There is a 5px orange border across the top of each product name.

    Is it best to have the price as a <dt> or a <dd>?

    Is it best to have each product name as a different class, with border and text colour in this class?

    Hope I've explained that ok,

    Thanks

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,121
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by qwaerstd View Post
    Is it best to have the price as a <dt> or a <dd>?
    There will be lots of opinions on this I'd wager, but personally, if I used a dl at all on this, I'd use <dd> for price and description. Not sure if I'd use one for each or have them together in a single one, either.

    Is it best to have each product name as a different class, with border and text colour in this class?
    It would be easiest to use a different class to indicate the different color, though for the border, all you need to say is

    Code:
    dt {border-top: 5px solid orange;}
    etc. No point in repeating that over and over.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  3. #3
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,882
    Mentioned
    122 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by ralph.m View Post
    There will be lots of opinions on this I'd wager, but personally, if I used a dl at all on this, I'd use <dd> for price and description. Not sure if I'd use one for each or have them together in a single one, either.
    I'd go with two separate definitions, just for neatness and because you can then style them differently if the mood takes you.
    Code:
    <dt>Product name</dt>
    <dd>Price</dd>
    <dd>Description</dd>
    Slap on whatever classes and IDs you need.

  4. #4
    SitePoint Enthusiast
    Join Date
    Feb 2010
    Posts
    83
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks! Pretty much confirms what I thought but it's nice to have some reassurance


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
  •