<blockquote> Block quotation
A longer quotation from another source, set apart as its own block.
<blockquote> holds a quotation from another source, usually several sentences long. Browsers indent it by default, and it can contain paragraphs, lists and other blocks.
You can put the source URL in the cite attribute. Nobody sees it, though, so name the source in visible text as well, for example in a <figcaption> or a <cite> element. Indenting text that is not a quotation is a CSS job.
According to the blockquote element definition (opens in a new tab), attribution belongs outside the blockquote, in a figcaption for instance. Practise it in the Quotes and Code lesson.
Syntax
<blockquote cite="https://example.com/source">
<p>Quoted text.</p>
</blockquote>When to use it
Reach for <blockquote> when you reproduce a passage from somewhere else at length: a paragraph from a court ruling in a news story, a customer testimonial on a product page, a clause from a law in a policy explainer, or an earlier message quoted in a forum reply. The test is simple. A quote that sits inside your own sentence takes the q element, and one that stands on its own as one or more paragraphs takes blockquote.
One case trips up many authors: the pull quote. Magazines often repeat a striking line from the same article in large type. That text is not quoted from another source, so the standard suggests marking it up as an aside element (opens in a new tab) instead. Also wrap the quoted words in <p> elements rather than leaving bare text, so multi-paragraph quotes keep their structure and your CSS for paragraphs applies inside the quote too.
Attributes
| Attribute | What it does |
|---|---|
cite | URL of the source of the quotation (not displayed). |
Live example
Edit the code and watch the preview.
<figure>
<blockquote cite="https://www.w3.org/standards/">
<p>The power of the Web is in its universality.</p>
</blockquote>
<figcaption>Tim Berners-Lee</figcaption>
</figure>More examples
Forum reply quoting a message
In a discussion thread, a reply often repeats part of an earlier post before answering it. The quoted post goes in a blockquote, the name of the person comes before it in normal text, and the reply follows as a regular paragraph.
<p><strong>Sam</strong> wrote:</p>
<blockquote>
<p>Does anyone know if pancakes can be frozen?</p>
</blockquote>
<p>Yes! Stack them with baking paper between each one and freeze them for up to two months.</p>Multi-paragraph book quote
A blockquote can hold several paragraphs. Here a passage from a classic novel gets a left border with CSS, and the source is credited after the quote with the cite element for the book title.
<blockquote style="border-left:4px solid #ccc;margin-left:0;padding-left:16px">
<p>Alice was beginning to get very tired of sitting by her sister on the bank, and of having nothing to do.</p>
<p>Once or twice she had peeped into the book her sister was reading, but it had no pictures or conversations in it.</p>
</blockquote>
<p>— Lewis Carroll, <cite>Alice's Adventures in Wonderland</cite></p>Tip: The cite attribute is hidden, so name the source in visible text.
Browser support
blockquote has been part of HTML since the earliest versions and works in every browser. Browsers give it a default margin of about 40px on the left and right, which you can change with CSS. The cite attribute is valid, but no mainstream browser displays it or turns it into a link.
Accessibility
Some screen readers announce where a blockquote starts and ends. Use it for real quotations only, or users get misleading cues. The W3C note Understanding Info and Relationships (opens in a new tab) explains why markup has to match the content.
Common mistakes
Wrong
<blockquote>Indented paragraph of my own text</blockquote>Right
<p class="indented">Indented paragraph of my own text</p>blockquote means quoted content. Indent with CSS margin or padding.
Wrong
<blockquote>
<p>Stay hungry.</p>
<p>- Steve Jobs</p>
</blockquote>Right
<figure>
<blockquote><p>Stay hungry.</p></blockquote>
<figcaption>Steve Jobs</figcaption>
</figure>The attribution is not part of the quote, so it goes outside blockquote.
Frequently asked questions
How do I add the author of a blockquote?
Put it outside the <blockquote>, since everything inside counts as quoted text. The usual pattern is a <figure> holding the blockquote and a <figcaption> with the author, plus <cite> for the title of the work if you like. The cite attribute can carry the source URL as well, but browsers do not display it. Titles of quoted works are covered on the cite element page.
What is the difference between blockquote and q?
Length and position. <blockquote> is for longer quotations that stand as a block of their own, usually one or more paragraphs. <q> is inline, meant for short quotations inside a sentence, and browsers add quotation marks around it automatically. Neither belongs around text that nobody is quoting. The typographic convention behind block quotes is explained in Wikipedia's article on block quotations (opens in a new tab).
Practise it
- Quotes and Code (Module 2: Text)