SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    Pedantic Semantic blain's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    528
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Semantic clarification needed

    This is bothering me.

    Code HTML4Strict:
    <p class="product-price">
    <span class="exc-vat"><span>Price</span>
    &pound;200 exc. VAT</span>
    <span class="inc-vat">&pound;230 inc. VAT</span>
    </p>

    It's not really a paragraph, what container would you use?
    Technology is dominated by two types of people:
    those who understand what they do not manage,
    and those who manage what they do not understand.

  2. #2
    SitePoint Addict
    Join Date
    Dec 2008
    Location
    Brussels
    Posts
    377
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Like this:

    Code:
    <p class="product-price">
    Price <span class="exc-vat">&pound;200 </span>exc. VAT<span class="inc-vat">&pound;230 </span>inc. VAT
    </p>

  3. #3
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think it's as close to a paragraph as makes no difference. If you don't want to mark it up as a paragraph, you probably need to use a div, which I'd say is worse.

    Of course, you could claim that it's a one-item definition list …
    Code HTML4Strict:
    <dl class="product-price">
      <dt>Price</dt>
      <dd>&pound;200 <abbr>exc.</abbr> <abbr>VAT</abbr></dd>
      <dd>&pound;230 <abbr>inc.</abbr> <abbr>VAT</abbr></dd>
    </dl>
    Code CSS:
    dl.product-price dt,
    dl.product-price dd {
      display:inline;
      margin:0;
      padding:0;
    }
    This might look a bit odd when unstyled, though, which is usually an indication that one is travelling down the wrong mental pathway.
    Birnam wood is come to Dunsinane

  4. #4
    The Mind's I ® silver trophy Dark Tranquility's Avatar
    Join Date
    Sep 2003
    Location
    KSA - UAE
    Posts
    9,457
    Mentioned
    8 Post(s)
    Tagged
    1 Thread(s)
    I don't know why it bothers you to consider it as a paragraph?
    If you will have many products for which you are going to list Prices and VAT you can consider it as a tabular data and hence use a table...


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
  •