Quotations in HTML
? Quotations in HTML
HTML provides special elements to mark quotations and quoted text clearly.
1. <q> — Inline Quotation
Used for short, inline quotations within a paragraph.
Browsers usually add quotation marks automatically.
<p>She said, <q>HTML is fun to learn!</q></p>Output:
She said, “HTML is fun to learn!”
2. <blockquote> — Block Quotation
Used for longer quotations displayed as a separate block.
Typically indented by browsers to stand out.
<blockquote> <p>This is a longer quotation that stands out from the rest of the text.</p></blockquote>3. The cite Attribute
Can be used with
<blockquote>or<q>to provide a URL or source of the quote.
<blockquote cite="https://www.example.com/article"> <p>Quote content here...</p></blockquote>Summary
| Element | Usage | Output Style |
|---|---|---|
<q> | Short inline quotations | Quotation marks added inline |
<blockquote> | Long, block-level quotations | Indented block |
cite attr | Source of the quote | Metadata (not visible by default) |
Need examples on styling quotations or using quotes in different languages?