HTML <q>
Tag
Topic: HTML5 Tags ReferencePrev|Next
Description
The <q>
tag defines a short inline quotation. It differs from <blockquote>
, which is a block-level element used for longer quotations.
The following table summarizes the usages context and the version history of this tag.
Placement: | Block |
---|---|
Content: | Block, inline, and text |
Start/End Tag: | Start tag: required, End tag: required |
Version: | HTML 4, 4.01, 5 |
Note: The <q>
tag is intended for short quotations (inline-level content) that don't require paragraph breaks, for long quotations (block-level content) use the <blockquote>
tag instead.
Syntax
The basic syntax of the <q>
tag is given with:
The example below shows the <q>
tag in action.
Example
Try this code »<p>John said, <q>He loves Star Wars movies.</q></p>
Tag-Specific Attributes
The following table shows the attributes that are specific to the <q>
tag.
Attribute | Value | Description |
---|---|---|
cite |
URL | Specifies the URL that designates a source document or message for the information quoted. |
Global Attributes
Like all other HTML tags, the <q>
tag supports the global attributes in HTML5.
Event Attributes
The <q>
tag also supports the event attributes in HTML5.
Browser Compatibility
The <q>
tag is supported in all major modern browsers.
Basic Support—
|
Further Reading
See tutorial on: HTML Text Formatting.
Related tag: <blockquote>
.