Description
The HTML element <q>
is used to define a short inline quotation.
Browsers display an inline quotation with double quotes around its content.
It differs from the <blockquote>
element, which is used to define a long block quotation.
The below table summarizes its usage.
Usage Details | |
Placement | It is displayed as an Inline element. |
Contents | It can contain Inline elements and text. |
Tags | Both the opening and closing tags are required. |
Versions | HTML 4, 4.01, 5 |
Syntax
Here is the basic syntax of the <q>
element.
<q>...</q>
Examples
<!DOCTYPE html>
<html lang="en">
<head>
<title>Example - HTML Element q</title>
</head>
<body>
<p>Jack said, <q>He loves animated movies.</q></p>
</body>
</html>
Attributes
The following table shows the list of supported and unsupported attributes for the <q>
element.
Attribute Type | Details |
Element-Specific Attributes | The tag <q> has some element-specific attributes listed in the below table. |
Global Attributes | Like all other HTML tags, the tag <q> supports the HTML Global Attributes. |
Event Attributes | The tag <q> also supports the HTML Event Attributes. |
Here is a list of attributes that are specific to the <q>
element.
Attribute | Value | Required | Description |
cite |
URL | No | Specifies the source URL for the text used within the inline quotation. |
Browser Compatibility
The tag <q>
is supported in all modern browsers.
- Google Chrome 1+
- Internet Explorer or Edge 4+
- Firefox 1+
- Apple Safari 1+
- Opera 4+