59

Hi I'm seeing a great number of different ways to implementat blockquote in html but it doesn't seem clear in its documentation how should I properly format a blockquote let's say of a famous quote and metion its author like:

In victory, you deserve Champagne, in defeat, you need it.

Napoleon Bonaparte

What would the correct format of that be in HTML5?

Should the author be inside or outside the blockquote tag? Should it be inside the cite attribute? (even knowing the documentation specifies an URI , not author)

0

6 Answers 6

63

I googled about this and it looks like <figure> and <figcaption> should do the job:

<figure>
  <blockquote cite="https://developer.mozilla.org/samples/html/figure.html">
    Quotes, parts of poems can also be a part of figure.
  </blockquote>
  <figcaption>MDN editors</figcaption>
</figure>

https://developer.mozilla.org/samples/html/figure.html

<figure>
  <blockquote cite="http://www.w3.org/html/wg/drafts/html/master/grouping-content.html#the-figure-element">
    The figure element represents some flow content, optionally with a caption,
    that is self-contained and is typically referenced as a single unit from the
    main flow of the document.
  </blockquote>
  <figcaption>asdf</figcaption>
</figure>

http://www.w3.org/html/wg/drafts/html/master/grouping-content.html#the-figure-element

1
  • Thanks very much- this is extremely helpful. Seems to be a lot of confusion out there surrounding a seemingly simple question.
    – nickpish
    Jul 25, 2013 at 2:35
23

UPDATE 2020

WHATWG says about the blockquote element

Attribution for the quotation, if any, must be placed outside the blockquote element.

WHATWG says about the cite element

The cite element represents the title of a work (e.g. a book, a paper, [...])

A person's name is not the title of a work [...] and the element must therefore not be used to mark up people's names.

So the following HTML it's fine:

<blockquote>
 <p>In victory, you deserve Champagne, in defeat, you need it.</p>
</blockquote>
<p>— Napoleon Bonaparte</p>

OLD POST 2018

HTML 5.3 Editor’s Draft, 9 March 2018

W3C says about the cite element:

The cite element represents a reference to a creative work. It must include the title of the work or the name of the author (person, people or organization) or an URL reference, or a reference in abbreviated form as per the conventions used for the addition of citation metadata.

So the following HTML it's fine:

<blockquote>
    Those who pass by us, do not go alone, and do not leave us alone; 
    they leave a bit of themselves, and take a little of us.
    <cite>Antoine de Saint-Exupéry</cite>
</blockquote>
2
  • 1
    Just want to note that <cite> should not be used here. A citation is not a quote (for which the q element is appropriate).
    – jsun
    Oct 15, 2019 at 17:06
  • Thank you @jsun, you're right. The specification has changed and I have already updated the post. Aug 28, 2020 at 23:34
18

This is how Bootstrap does quotes in v3.3.

<blockquote>
  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
  <footer>Someone famous in <cite title="Source Title">Source Title</cite></footer>
</blockquote>

More on the footer element from MDN: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/footer

The HTML <footer> Element represents a footer for its nearest sectioning content or sectioning root element (i.e, its nearest parent <article>, <aside>, <nav>, <section>, <blockquote>, <body>, <details>, <fieldset>, <figure>, <td>). A footer typically contains information about the author of the section, copyright data or links to related documents.

You may also consider using Structured Data, such as microdata, RDFa, and microformats.

3
  • It is invalid, documentation says that cite shoudnt be a person's name Jan 7, 2016 at 19:42
  • @YannChabot like this: <footer>Author Name, <cite title="Book Name">Book Name</cite></footer>
    – skibulk
    Jan 8, 2016 at 11:33
  • 1
    You are right, they changed the documentation, back then they said that cite couldn't be used to cite a person, now you can Jan 8, 2016 at 14:50
16

http://neilpie.co.uk/2011/12/13/html5-quote-attribution/

For example, use

<small class="author">Napoleon Bonaparte<small>

HTML 5 documentation says, "Small print typically features disclaimers, caveats, legal restrictions, or copyrights. Small print is also sometimes used for attribution, or for satisfying licensing requirements."

2
  • 1
    Could you add a link to the HTML 5 documentation for the quote? Jul 4, 2015 at 20:19
  • 1
    It doesn't seems to say that anymore as you can see, here is what the W3C is saying about it: The small element represents so-called “fine print” or “small print”, such as legal disclaimers and caveats. w3.org/TR/html-markup/small.html Jan 7, 2016 at 19:40
0

My preference and it validates...

<!doctype html>
<html lang="en">
<head><title>Blockquote Test</title></head>
<body>

<div style="width:300px;border:1px solid #cecece; padding:10px;">

<blockquote cite="URL">
In victory, you deserve Champagne, in defeat, you need it.
</blockquote>
<div class="credit" style="text-align:right;">
<cite><a href="URL">Napoleon Bonaparte</a></cite>
</div>

</div>

</body>
</html>
7
  • 10
    As the specification says, a cite element must not contain a person's name. Mar 29, 2011 at 15:29
  • 1
    <cite> is for "citing" the title, not the author :) Jul 19, 2012 at 5:27
  • 3
    So then how do you cite the author? Jun 4, 2013 at 16:38
  • 12
    @JosephMansfield 3 years later it looks like the specification has changed: "The cite element represents a reference to a creative work. It must include the title of the work or the name of the author(person, people or organization) or an URL reference, which may be in an abbreviated form as per the conventions used for the addition of citation metadata."
    – h2ooooooo
    Mar 19, 2014 at 13:18
  • @h2ooooooo Following the current status of the W3 page, it has still changed and can't be used anymore to refer to a person. But following the this other W3 page, it can still be used.
    – meduz'
    Jun 16, 2015 at 11:18
0

This can be covered by Bootstrap 4 <footer class="blockquote-footer"> element:

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js"></script>

<blockquote class="blockquote">
  <p>In the digital age, knowledge is our lifeblood. And documents are the DNA of knowledge.</p>
  <footer class="blockquote-footer">Rick Thoman, CEO, <cite title="Xerox Corporation">Xerox</cite></footer>
</blockquote>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.