Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML

Whats the difference between <blockquote> and <q> tags?

Whats the difference between <blockquote> and <q> tags?

2 Answers

Jamie Reardon
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Jamie Reardon
Treehouse Project Reviewer

You can use the q tag for short inline quotations like so:

<q>This is a pull quote from the book of...</q>

You can use a blockquote tag for marking up long, multi-line quotations. For instance, if you're writing a blog post where you quote an excerpt from a book, article, or another source, you should wrap that quote inside blockquote tags.

<blockquote>
   In the sky there are always answers and explanations for everything: every pain, every suffering, joy and confusion.”...
</blockquote>

Inside the opening blockquote tag you can optionally use the cite attribute to include a reference to the text you're quoting. So as the value, you include the link to the source of the quote.

<blockquote cite="https://www.goodreads.com/quotes/tag/long"> In the sky there are always answers and explanations for everything: every pain, every suffering, joy and confusion.”... </blockquote>

You can also credit the author of the quote using cite tags within the blockquote.

<blockquote> In the sky there are always answers and explanations for everything: every pain, every suffering, joy and confusion.”.... - <cite><a href="https://www.goodreads.com/quotes/tag/long">Author Name</a></cite> </blockquote>

Finally, in a blockquote, it's also acceptable to attribute the author or source within a footer element.

<blockquote>
    In the sky there are always answers and explanations for everything: every pain, every suffering, joy and confusion.”.... 
    <footer>
         - <cite><a href="https://www.goodreads.com/quotes/tag/long">
        Author Name</a></cite>
    </footer>
</blockquote>

In short, use q tags for short inline quotations and use blockquotes for marking up long/multi-line quotations.