totn HTML

HTML: <q> tag

This HTML tutorial explains how to use the HTML element called the <q> tag with syntax and examples.

Description

The HTML <q> tag defines a short inline quotation in the HTML document from another source. Browsers traditionally render quotation marks around the text found within the <q> tag. This tag is also commonly referred to as the <q> element.

Syntax

In HTML, the syntax for the <q> tag is:

<body>
<p><q>Short quotation goes here</q></p>
</body>

Sample Output


Attributes

In addition to the Global Attributes, the following is a list of attributes that are specific to the <q> tag:

Attribute Description HTML Compatibility
cite URL for the source document or a message for the quotation explaining the reference for the quote. HTML 4.01, HTML5

Note

Browser Compatibility

The <q> tag has basic support with the following browsers:

  • Chrome
  • Android
  • Firefox (Gecko)
  • Firefox Mobile (Gecko)
  • Internet Explorer (IE)
  • Edge Mobile
  • Opera
  • Opera Mobile
  • Safari (WebKit)
  • Safari Mobile

Example

We will discuss the <q> tag below, exploring examples of how to use the <q> tag in HTML5, HTML 4.01 Transitional, XHTML 1.0 Transitional, XHTML 1.0 Strict, and XHTML 1.1.