tags:

views:

288

answers:

4

Hi,

I thought this would be an easy enough thing to find online but it seems not. I'm trying to find out what would be considered the correct way to mark up a list of testimonials - quotes with authors - on a page.

e.g.

"This is what I think"
- My Name, My Company

I'd imagine the quote should go in a blockquote. I've also seen some use of cite to shown where a quote comes from but the HTML reference seems to show that this should be used to give the URL of a web page that the quote comes from, not the name of the person.

Does anyone have any suggestions for how this should be marked up?

Thanks,

Kev

A: 

If you are asking how this should be marked up semantically, yes, use a block quote, and yes, the cite attribute is for URL's. As for presentation, you could use whatever you want and style it accordingly.

Visitors will never see the difference unless they look at the source code, and I can't imagine that it would affect SEO either.

Keith Bentrup
The cite attribute is for URIs, not just URLs. You could, for instance, use an ISBN URN if you were quoting from a book.
David Dorward
I'm aware. I was using his terminology for simplicity.
Keith Bentrup
+3  A: 

You may be interested in using the hReview format--Google is rumored to support it, and it's pretty much applicable to your situation, depending on whether you're only interested in the appearance, or whether you want to facilitate machine readability as well.

Michiel Buddingh'
Thanks - I didn't think of using of using a review mf for a testimonial - great idea!
Kevin Wilson
+6  A: 

You are correct in your assumption that a quote is supposed to go into a blockquote element and that the cite attribute should be used for the URI. Personally I handle the author of the quote with a separate div or p at the bottom of the quote like so:

<blockquote cite="http://a.uri.com/"&gt;
    <p>This is a really insightful sentence.</p>
    <p class="quoteCite">Darko Z</p>
</blockquote>

Then I just use CSS to make it look nice. Pretty basic. You might want to go look at Microformats.org as well and search around for ideas.

Hope this helps

EDIT: Its late and it slipped my mind but you could also use the cite element

<blockquote cite="http://a.uri.com/"&gt;
    <p>This is a really insightful sentence.</p>
    <cite>Darko Z</cite>
</blockquote>

but im not a 100% sure how well its supported, to be honest

EDIT 2: According to the HTML 5 draft, cite shoudn't be an author name so for future proofing you probably shouldn't use cite for that purpose.

Darko Z
The cite isn't part of the quote, it should be outside the blockquote element. Blockquote is for quoting block content, so you should wrap paragraph (for instance) elements around the content of them.
David Dorward
Agreed about wrapping content - have updated code. still not so certain about whether the cite should be a part of the quote or not (though thats the way i have done in the past). Looking for credible sources right now to see what they say...
Darko Z
Thanks for comments and suggestions. Microformats examples all seem to involve removing the blockquote element altogether; which seems a little strange.I had a quick look through the HTML 5 draft. Handy that they say cite shouldn't be used for the author name then neglect to say what should be used for it.So, probably going to use some mish-mash of blockquote, cite and microformats.Thanks again,K
Kevin Wilson
RE: what element to use for names. From HTML 5 Working Draft, 23 April 2009: "In some cases, the b element might be appropriate for names; e.g. in a gossip article where the names of famous people are keywords rendered with a different style to draw attention to them. In other cases, if an element is really needed, the span element can be used."
outis
A: 
<!DOCTYPE html>
<blockquote>
  <p>Quote
</blockquote>
<p>Author

would be the most correct.

Ms2ger