<q>
The <q> element represents a short inline quotation. Browsers typically render this with quotation marks automatically, though the exact style depends on the language and browser.
This page was last updated on 2025-11-27
Syntax
<q>quoted text</q>
Attributes
- cite - URL of the source document
- class - CSS class name
- id - Unique identifier
- style - Inline CSS styles
- lang - Language (affects quotation mark style)
Examples
Basic inline quote:
<p>She said <q>Hello, world!</q> and smiled.</p>
With cite attribute:
<p>The manual states that <q cite="https://docs.example.com">users must log in first</q>.</p>
Nested quotes:
<p>He mentioned that <q>the teacher said <q>practice makes perfect</q> every day</q>.</p>
With attribution:
<p>As Einstein noted, <q>imagination is more important than knowledge</q>.</p>
When to Use
Use <q> for short quotations that are part of a sentence flow and do not require paragraph breaks. The browser automatically adds appropriate quotation marks based on the document language, so you should not add your own quotes around the content.
For longer block-level quotations that span multiple sentences or paragraphs, use <blockquote> instead. The cite attribute provides machine-readable source information but is not displayed by browsers. For visible attribution, add the author name in regular text.
Related Elements
- <blockquote> - Block quotation
- <cite> - Citation or reference
- <em> - Emphasized text