<q>

  • Revision slug: HTML/Element/q
  • Revision title: q
  • Revision id: 17382
  • Created:
  • Creator: McGurk
  • Is current revision? No
  • Comment Cleaned up page; 75 words added, 7 words removed

Revision Content

Quote element indicates that the enclosed text is a short inline quotation.

Content categories Flow content, phrasing content
Permitted content Phrasing content
Tag omission None, must have both a start tag and an end tag.
Permitted parent elements Any element that accepts phrasing content, or any element that accepts flow content.
Normative document HTML5, section 4.10.5; HTML 4.01, section 9.2.2

Attributes

Like all other HTML elements, this element supports the global attributes.

{{ htmlattrdef("cite") }}
The value of this attribute is a URL that designates a source document or message for the information quoted. This attribute is intended to point to information explaining the context or the reference for the quote.

DOM interface

This element implements the HTMLQuoteElement interface.

Example

<p>Everytime Kenny is killed, Stan will announce <q>Oh my God, you/they killed Kenny!</q>.</p>

Above HTML will output:

Image:HTML-q.png

Notes

This element is intended for short quotations that don't require paragraph breaks, for long quotations use <blockquote> element.

Most modern standards-aware browsers, like Mozilla Firefox, Opera, and Safari, should add quotes around text enclosed within the <q> element.

Some browsers, like Internet Explorer, may not make any sort of style change for quotations, but it is possible to apply a style rule.

See also


{{ HTML:Element_Navigation() }}

{{ languages( { "pl": "pl/HTML/Element/q" } ) }}

Revision Source

<p><strong>Quote</strong> element indicates that the enclosed text is a short inline quotation.</p>
<table class="standard-table"> <tbody> <tr> <td>Content categories</td> <td><a href="/en/HTML/Content_categories#Flow_content" title="en/HTML/Content categories#Flow content">Flow content</a>, <a href="/en/HTML/Content_categories#Phrasing_content" title="en/HTML/Content categories#Phrasing content">phrasing content</a><a href="/en/HTML/Content_categories#form-associated_content" title="en/HTML/Content categories#form-associated content"><br> </a></td> </tr> <tr> <td>Permitted content</td> <td><a href="/en/HTML/Content_categories#Phrasing_content" title="en/HTML/Content categories#Phrasing content">Phrasing content</a><a href="/en/HTML/Content_categories#form-associated_content" title="en/HTML/Content categories#form-associated content"><br> </a></td> </tr> <tr> <td>Tag omission</td> <td>None, must have both a start tag and an end tag.</td> </tr> <tr> <td>Permitted parent elements</td> <td>Any element that accepts <a href="/en/HTML/Content_categories#Phrasing_content" title="https://developer.mozilla.org/en/HTML/Content_categories#Phrasing_content">phrasing content</a>, or any element that accepts <a href="/en/HTML/Content_categories#Flow_content" title="https://developer.mozilla.org/en/HTML/Content_categories#Flow_content">flow content</a>.</td> </tr> <tr> <td>Normative document</td> <td><a class="external" href="http://www.w3.org/TR/html5/text-level-semantics.html#the-q-element" title="http://www.w3.org/TR/html5/the-button-element.html#the-keygen-element">HTML5, section 4.10.5</a>; <a class="external" href="http://www.w3.org/TR/html401/struct/text.html#h-9.2.2 title=">HTML 4.01, section 9.2.2</a></td> </tr> </tbody>
</table>
<h3 name="Attributes">Attributes</h3>
<p>Like all other HTML elements, this element supports the <a href="/en/HTML/Global_attributes" title="en/HTML/Global attributes">global attributes</a>.</p>
<dl> <dt> </dt><dt>{{ htmlattrdef("cite") }}</dt> <dd>The value of this attribute is a URL that designates a source document or message for the information quoted. This attribute is intended to point to information explaining the context or the reference for the quote.</dd>
</dl>
<h3 name="Example">DOM interface</h3>
<p>This element implements the <code><a href="/en/DOM/HTMLQuoteElement" rel="internal">HTMLQuoteElement</a></code> interface.</p>
<h3 name="Example">Example</h3>
<pre class="brush: html">&lt;p&gt;Everytime Kenny is killed, Stan will announce &lt;q&gt;Oh my God, you/they killed Kenny!&lt;/q&gt;.&lt;/p&gt;
</pre>
<p>Above HTML will output:</p>
<p><img alt="Image:HTML-q.png" class=" internal" src="/@api/deki/files/246/=HTML-q.png"></p>
<h3 name="Notes">Notes</h3>
<p>This element is intended for short quotations that don't require paragraph breaks, for long quotations use <a href="/en/HTML/Element/blockquote" title="en/HTML/Element/blockquote"><code>&lt;blockquote&gt;</code></a> element.</p>
<p>Most modern standards-aware browsers, like Mozilla Firefox, Opera, and Safari, should add quotes around text enclosed within the <code>&lt;q&gt;</code> element.</p>
<p>Some browsers, like Internet Explorer, may not make any sort of style change for quotations, but it is possible to apply a style rule.</p>
<h3 name="See_also">See also</h3>
<ul> <li><a href="/en/HTML/Element/blockquote" title="en/HTML/Element/blockquote">HTML Block quotation element</a></li> <li><a href="/en/HTML/Element/cite" title="en/HTML/Element/cite">HTML Citation element</a></li>
</ul>
<p><br>
{{ HTML:Element_Navigation() }}</p>
<p>{{ languages( { "pl": "pl/HTML/Element/q" } ) }}</p>
Revert to this revision