SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Zealot
    Join Date
    Nov 2005
    Posts
    167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Post seodevhead's response...

    I have a custom blog script that allows comments to be added by registered members, much like here on Sitepoint's blogs. This is what they look like underneath the main blog:

    Example:
    ----------------------------------

    Seodevhead's Response:

    "It is of utmost importance that we find a way to control...continue paragraphs here"

    ----------------------------------

    WebGuy2005's Response:

    "While we are at a crossroads in the framework for the detrimental.... continue paragraphs here"

    ----------------------------------


    The part's that read "seodevhead's response:" and "WebGuy2005's Response:"... what XTHML element should I use to mark these? I don't want to use a header tag because obviously these are not in relation to the topic of the blog. Any ideas? Thanks.

  2. #2
    SitePoint Wizard
    Join Date
    Oct 2005
    Location
    London
    Posts
    1,678
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    HI there,

    Semantically it would make sense to use a definition list here. You can use dt for the comments name and dd for their response. They can then be styled as you want.

    http://www.w3.org/TR/html4/struct/lists.html

  3. #3
    SitePoint Zealot
    Join Date
    Nov 2005
    Posts
    167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by elduderino
    HI there,

    Semantically it would make sense to use a definition list here. You can use dt for the comments name and dd for their response. They can then be styled as you want.

    http://www.w3.org/TR/html4/struct/lists.html
    Would it be wise to wrap a page worth of <p> text content in <dd> tags?

  4. #4
    SitePoint Wizard
    Join Date
    Oct 2005
    Location
    London
    Posts
    1,678
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Would it be wise to wrap a page worth of <p> text content in <dd> tags?
    If it makes sense to then yes.

    I so suppose if its going to be a whole page then your code may become a little bloated.

    I think you just said it yourself. If its p text content and theres alot then leave it at that. The only sacrafice is your semantics

  5. #5
    SitePoint Zealot
    Join Date
    Nov 2005
    Posts
    167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The actual comments I want to use a <p> tag. But the comments is not what is in question. It is the little header above the comment that says...

    "User X's Response:"

    Obviously this has nothing to do with the topic of the page and thus does not deserve a heading element. Definition list for this one part seems a bit much. Any other ideas?

  6. #6
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,236
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    I've commonly seen the entire comments section marked up as an ordered list (every comment being a list item) and the commenter's name marked up as <cite></cite>, possibly with a link back to the original post.

    Here's an example from a standard Wordpress template:
    HTML Code:
    <ol id="comments">
    <li class="alt" id="comment-9">
    			<p><cite>vinnie</cite> Says:</p>
    			
    			<small class="commentmetadata"><a href="#comment-9" title="">September 22nd, 2006 at 4:27 pm</a> </small>
    
    			<p>test</p>
    
    		</li>
    </ol>

  7. #7
    SitePoint Wizard
    Join Date
    Oct 2005
    Location
    London
    Posts
    1,678
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yep, id say its either or then, both make sense.

    What else are you going to do with "user x response"? its not a header as you say, you dont want a load of p classes right through your source. Its gotta be the dl or ol. Although i think the definition would be cleaner

  8. #8
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It might be possible to use a DL here, since the HTML spec explicitly says that DL can be used to mark up dialogue. Using the CITE and BLOCKQUOTE elements is more important, semantically, though.
    HTML Code:
    <dl>
      <dt><cite>Seodevhead</cite>'s Response:</dt>
      <dd><blockquote><p>It is of utmost importance...</p></blockquote></dd>
    
      <dt><cite>WebGuy2005</cite>'s Response:</dt>
      <dd><blockquote><p>While we are at a crossroads...</p></blockquote></dd>
    </dl>
    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
  •