HTML <q>

BrandonDusch's avatar
Published Mar 4, 2022Updated Jul 1, 2022
Contribute to Docs

The <q> element is used to represent a brief inline quotation, as opposed to the <blockquote> element being used for longer ones.

It accepts a cite attribute that links to a valid URL that provides further context for the quotation.

  • Front-end engineers work closely with designers to make websites beautiful, functional, and fast.
    • Includes 34 Courses
    • With Professional Certification
    • Beginner Friendly.
      115 hours
  • Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.
    • Beginner Friendly.
      7 hours

Syntax

<q cite=""><!-- Brief quotation goes inside the tag --></q>

The <q> element requires an opening and closing tag wrapped around a line of text. The browser will automatically enclose the text in quotation marks.

Example

<!-- The text between the q tags will be surrounded by quotation marks -->
<p>
The World Wide Web Consortium's idea of the Web includes
<q cite="https://www.w3.org/Consortium/mission">
participation, sharing knowledge, and thereby building trust on a global
scale.
</q>
One can't help but agree with it!
</p>

Example of what the rendered text would look like

All contributors

Contribute to Docs

Learn HTML on Codecademy

  • Front-end engineers work closely with designers to make websites beautiful, functional, and fast.
    • Includes 34 Courses
    • With Professional Certification
    • Beginner Friendly.
      115 hours
  • Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.
    • Beginner Friendly.
      7 hours