Français

<q>

Slipping a short quotation into the text flow

  • HTML
  • accessibility
  • semantics

<q> — The inline quotation

The <q> element represents a short inline quotation. The browser automatically adds quotation marks appropriate for the document language.

When to use it

You want to quote a few words or a short sentence within your paragraph. For an entire block, use <blockquote> instead. The cite attribute lets you point to the source.

What you gain

Accessibility: the browser adds quotation marks automatically and adapts them to the language (lang). Screen readers read the text with the quotation marks, signalling the quote effortlessly.

Code example

<p>
  As Alan Kay said,
  <q cite="https://example.com/talk">The best way to predict
  the future is to invent it.</q>
</p>

Further reading