In HTML, you can use the <blockquote>
and <q>
tags to create quotation and citation elements.
The <blockquote>
tag is used to indicate a longer quotation that is set apart from the surrounding text. It’s typically used to quote text from another source, such as a book or article. Here’s an example:
<blockquote>
<p>"The only way to do great work is to love what you do. If you haven't found it yet, keep looking. Don't settle. As with all matters of the heart, you'll know when you find it."</p>
<footer>- Steve Jobs</footer>
</blockquote>
In this example, the <blockquote>
tag is used to indicate the beginning and end of the quotation, and the <p>
tag is used to contain the actual text of the quotation. The <footer>
tag is used to indicate the source of the quotation.
The <q>
tag is used to indicate a shorter quotation that is part of the surrounding text. It’s typically used to quote a phrase or sentence. Here’s an example:
<p>The famous phrase "I have a dream" was spoken by <q>Dr. Martin Luther King Jr.</q> during his famous speech in Washington D.C. in 1963.</p>
In this example, the <q>
tag is used to indicate the part of the text that is being quoted.
Both the <blockquote>
and <q>
tags can be used with a cite
attribute to indicate the source of the quotation. Here’s an example:
<blockquote cite="https://www.brainyquote.com/quotes/steve_jobs_416545">
<p>"The only way to do great work is to love what you do. If you haven't found it yet, keep looking. Don't settle. As with all matters of the heart, you'll know when you find it."</p>
<footer>- Steve Jobs</footer>
</blockquote>
In this example, the cite
attribute is used to specify the URL of the source of the quotation.
Using quotation and citation elements can help make your HTML content more informative and credible, especially when you’re quoting from another source.