HTML / HTML Tags

HTML <Q> Tag

Dec 12, 2022
2 min read
HTML q Tag

Definition

The <q> tag indicates that the enclosed text is an inline quote. It may contain a cite attribute with a link to the source.

Example

<p>The Webmaster said <q>We're here to help you master the web</q>.
I agree with that statement.</p>

The Webmaster said We're here to help you master the web. I agree with that statement.

Usage

  • Both the opening and closing tags are required.
  • Quotation marks must not be inserted before, after, or inside the <q> tags. They will be inserted automatically by the browser.
  • Content inside a <q> must be quoted from a source. A link to the source, if any, should be specified in the cite attribute. These are primarily intended for server-side scripts collecting statistics, not for general readers.
  • The <q> element should not be used for items in quotation marks that do not quote anything. For example, a sarcastic statement.
  • The <q> element is optional. The use of simple quotation marks is equally correct.

Attributes

The <q> element supports the Global Attributes, as well as the following:

  • cite

    The cite attribute specifies the source URL for the quoted information. These are primarily intended for server-side scripts collecting statistics, not for general readers.

Best Practices

  • Use <blockquote> for long block-level quotations.
  • Use <q> for smaller inline quotations.

Specification

Browser Support

Desktop

ChromeEdgeFirefoxIEOperaSafari
YesYesYesYesYesYes

Mobile

Android WebviewChrome AndroidFirefox AndroidOpera AndroidiOS SafariSamsung Internet
YesYesYesYesYesYes