Introduction to HTML Quotation #
HTML Quotation refers to the way we mark up quoted text in HTML so that browsers, search engines, and assistive technologies understand it as a quotation. Proper use of quotation tags makes content more readable, accessible, and SEO-friendly.
Understanding the <q>
Tag #
The <q>
tag creates an inline quotation, ideal for short snippets of quoted text within a paragraph. Browsers typically add quotation marks around its content automatically.
Key points:
- Inline element, sits within a block of text.
- Automatically renders with quotation marks.
- Best for quotes of one or two sentences.
<p>My favorite quote is <q>Knowledge speaks, but wisdom listens.</q></p>
Using the <blockquote>
Tag #
The <blockquote>
tag is used for block-level quotations—longer excerpts or multi-paragraph quotes. By default, browsers indent this block to set it apart.
Key points:
- Block-level element; appears on its own line(s).
- Ideal for longer quotes from articles, speeches, or books.
- Can contain multiple paragraphs and other inline tags.
<blockquote>
The only limit to our realization of tomorrow is our doubts of today.
— Franklin D. Roosevelt
</blockquote>
The cite
Attribute for Source Attribution #
Both <q>
and <blockquote>
support the optional cite
attribute, which holds the URL or reference for the quoted source. This is important for SEO (shows credible sources) and accessibility (lets screen readers announce source).
<blockquote cite="https://www.widelamp.com/tutorial">
Your quoted text here.
</blockquote>
Other Related HTML Elements #
<cite>
: Marks up the title of a work (book, article, song).<abbr>
: Defines an abbreviation or acronym with an explanatory title.<address>
: Specifies contact information.<bdo>
: Overrides the bidirectional text direction (e.g., for RTL languages).
Practical Examples #
Inline Quotation with <q>
<p>Remember <q>to be yourself; everyone else is already taken.</q></p>
Block Quotation with Source
<blockquote cite="https://widelamp.com/quantum-computing/quantum-entanglement/">
Be yourself; everyone else is already taken.
</blockquote>
Combining <blockquote>
and <cite>
<blockquote cite="https://www.widelamp.com/tutorial">
Your quoted text here.
</blockquote>
Mastering HTML Quotation tags <q>
and <blockquote>
helps you create semantically rich, accessible, and SEO-optimized web pages. Use <q>
for short, inline quotes and <blockquote>
for longer excerpts, always attributing sources with cite
. By following these guidelines, your content will be clearer for readers, search engines, and assistive technologies.