HTML Quotations
In this page:
<blockquote cite="url">Quoted block</blockquote>
<q>Inline quote</q>
<abbr title="Full text">Abbr</abbr>
The blockquote Element
The blockquote tag wraps long, multi-line quotations that are taken from external sources. The browser automatically indents these sections to separate them visually from your normal body paragraphs.
- Use the cite attribute inside the blockquote to link search engines directly to the source URL.
- Accepted attributes:
- cite — URL of the source of the quotation
- Global attributes (id, class, lang) also apply
Example: The blockquote Element
<blockquote cite="https://example.com/source">
This is a long quotation taken from an external source,
which the browser indents to set it apart from the page's normal text.
</blockquote>
Short Inline Quotes with q
For short quotes that fit comfortably inside a regular paragraph, use the q tag. Instead of styling these quotes with indentations, the browser automatically wraps the text inside proper quotation marks.
- Avoid typing quotation marks manually inside a q tag, as the browser will do it for you.
- Accepted attributes:
- cite — URL of the source of the quotation
- Global attributes (id, class, lang) also apply
Example: Short Inline Quotes with q
<p>She said <q>this is a short quote</q> during the interview.</p>
Defining Abbreviations with abbr
The abbr tag identifies abbreviations and acronyms. By adding a title attribute to this tag, you can provide the full-form text. When a user hovers their mouse over the abbreviation, the full text appears as a small tooltip.
- Always include the title attribute to spell out the abbreviation for your visitors.
- Accepted attributes:
- title — the full expansion of the abbreviation
- Global attributes (id, class, lang) also apply
Example: Defining Abbreviations with abbr
<p>The <abbr title="HyperText Markup Language">HTML</abbr> standard defines web page structure.</p>
Creative Work Citations with cite
The cite tag is used to identify the title of a creative work, such as a book, a song, a movie, or a specific software tool. The browser automatically displays the text inside a cite tag in italics.
Example: Creative Work Citations with cite
<p>My favorite book is <cite>The Great Gatsby</cite>.</p>
Text Direction Overrides with bdo
The bdo (Bi-Directional Override) tag allows you to manually reverse the text direction. It is incredibly useful for supporting right-to-left languages (like Arabic or Hebrew) or creating quick visual text effects.
- Always specify the dir attribute inside a bdo tag to control the direction.
- Accepted attributes:
- dir — ltr | rtl (required on bdo)
- lang — language code such as en or ar
Example: Text Direction Overrides with bdo
<bdo dir="rtl">This text will be displayed right-to-left.</bdo>
The cite Attribute on blockquote
The cite attribute on a blockquote holds the URL of the source the quote came from. It is invisible to readers by default, but it gives browsers, search engines, and some assistive tools a machine-readable link back to the original source.
- Always add a cite attribute alongside a visible link to the source in your actual text, since cite alone is not visible to most readers.
- Accepted values:
- cite — a valid URL (absolute or relative) pointing to the source
- Also valid on q, ins and del
- Not displayed by browsers; visible attribution needs the cite element
Example: The cite Attribute on blockquote
<blockquote cite="https://example.com/article">
This quote's source URL is stored in the cite attribute,
but it isn't visible to readers.
</blockquote>
q vs blockquote: Which to Use
Use the q element for short quotations that flow inline within a sentence or paragraph — browsers automatically add quotation marks around it.
Use blockquote for longer quotations that stand apart as their own block, typically a full sentence or more, set visually apart from the surrounding text.
- If your quote is short enough to sit inside a normal sentence, reach for q.
- If it needs its own paragraph, use blockquote instead.
Example: q vs blockquote: Which to Use
<p>He mentioned <q>keep it simple</q> in passing.</p>
<blockquote>
This is a longer quotation that stands apart as its own block,
separated from the surrounding paragraph text.
</blockquote>
- Typing manual quotation marks inside a q tag, which displays duplicate quotation marks.
- Misusing the blockquote element strictly to create a visual left margin on standard paragraphs.
- Using the cite tag to format the name of a person rather than the title of a creative work.
- Use blockquote for long indented quotes and the q tag for short inline quotes with auto-generated quotation marks.
- Use abbr with the title attribute to provide tooltips for abbreviations.
- Use the cite tag to define creative titles, and the bdo tag to manually reverse text direction.
All modern browsers have complete, built-in support for quotation and citation elements.
Chapter Quiz — Complete all 11 topics to unlock
0/11 topics done
Complete these topics first: