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 theciteattribute. 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:
citeThe
citeattribute 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
| Chrome | Edge | Firefox | IE | Opera | Safari |
|---|---|---|---|---|---|
| Yes | Yes | Yes | Yes | Yes | Yes |
Mobile
| Android Webview | Chrome Android | Firefox Android | Opera Android | iOS Safari | Samsung Internet |
|---|---|---|---|---|---|
| Yes | Yes | Yes | Yes | Yes | Yes |
