<q>

Allows you to mark a short quotation on an HTML page.
2 min read
Believemy logo

The <q> tag is used in HTML to mark a short quotation, generally a passage taken directly from a text. It allows you to frame a quotation without the necessity of a block separation.

It is often used for quotations of one or two sentences extracted from a speech, a text, or a conversation.

Good to know

It is different from the <cite> tag, which is used to indicate the source of a quotation. If you want to indicate a source in addition to the quotation, it is preferable to combine the two tags: <q> for the quotation and <cite> for the source.

 

Structure and syntax of the <q> tag

Basic structure and syntax

The <q> tag is an inline tag that has:

  • An opening tag: <q>;
  • A closing tag: </q>.

It is used to frame a text that constitutes a short quotation.

 

Usage example

Here is a practical example:

HTML
<p>Albert Einstein said: <q>Imagination is more important than knowledge.</q></p>

In this example, Einstein's quotation is framed by the <q> tag, which clearly marks it as a quotation.

 

Attributes

The <q> tag accepts the classic HTML attributes (style, class, etc.), but it does not have specific attributes related to its functionality.

 

Difference with other similar tags

  • <cite>: The <cite> tag is used to indicate the source of a quotation, whereas <q> simply marks the quoted text.
  • <blockquote>: The <blockquote> tag is used for long or block quotations, often accompanied by a source attribute. It is generally more formal than <q>.

 

Browser compatibility

The <q> tag is supported by all modern browsers.

BrowserCompatibility
ChromeYes
FirefoxYes
SafariYes
EdgeYes
Internet ExplorerYes

Related terms

Discover our hTML and CSS glossary

Browse the terms and definitions most commonly used in HTML and CSS development.

Share this article

Want to help us? Share this article on your networks or even better: on your site, in an article or in your newsletter.