Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Semantically Correct Blockquote

I have 3 testimonials that I'm going to use in a website I'm working on. I've read up on block-quotes and I believe that this is the tag best suited for them.

Here is a basic blockquote I found on a forum:

<blockquote>
      <p>Pellensque.</p>
      <p>Pellentesque.</p>
      <p class="credit"><cite>Name</cite>, Title</p>  
</blockquote>

Is it semantically correct to use the cite tag to state a person's name and title?

I read that its intended use is to point to the original URL source of the quote.

Also, when inspecting some site's html, I found one that used an h3 for the quotation and h6 for the name and title. Is this in line with best practice?

Or is it better to adjust the text purely in CSS with line-weight and other properties?

like image 836
Edson Avatar asked Aug 14 '26 03:08

Edson


1 Answers

I read that its intended use is to point to the original URL source of the quote.

That would be the cite attribute of the <blockquote> element. See here in the HTML5 spec. What you're looking at is the <cite> element, for which marking up the title or author (as demonstrated) of a quotation is appropriate.

Also, when inspecting some site's html, I found one that used an h3 for the quotation and h6 for the name and title. Is this in line with best practice?

If the headings are part of the quotation, then marking up those headings with the respective h elements is fine, as you're reproducing the headings as-is. However, a citation is not a heading, so using a heading to mark up a citation is inappropriate.

Other than that, the <blockquote> element is ideal for marking up testimonials.

like image 192
BoltClock Avatar answered Aug 15 '26 21:08

BoltClock