Summary
The HTML <q>
Element (or HTML Quote Element) indicates that the enclosed text is a short inline quotation. This element is intended for short quotations that don't require paragraph breaks; for long quotations use {{HTMLElement("blockquote")}} element.
- Content categories Flow content, phrasing content, palpable content.
- Permitted content Phrasing content.
- Tag omission {{no_tag_omission}}
- Permitted parent elements Any element that accepts phrasing content.
- DOM interface {{domxref("HTMLQuoteElement")}}
Attributes
This element includes 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.
Example
<p>Everytime Kenny is killed, Stan will announce <q cite="https://en.wikipedia.org/wiki/Kenny_McCormick#Cultural_impact"> Oh my God, you/they killed Kenny! </q>. </p>
Above HTML will output:
Everytime Kenny is killed, Stan will announce Oh my God, you/they killed Kenny!
.
Specifications
Specification | Status | Comment |
---|---|---|
{{SpecName('HTML WHATWG', 'text-level-semantics.html#the-q-element', '<q>')}} | {{Spec2('HTML WHATWG')}} | |
{{SpecName('HTML5 W3C', 'text-level-semantics.html#the-q-element', '<q>')}} | {{Spec2('HTML5 W3C')}} | |
{{SpecName('HTML4.01', 'struct/text.html#h-9.2.2', '<q>')}} | {{Spec2('HTML4.01')}} |
Browser compatibility
{{CompatibilityTable}}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | {{CompatVersionUnknown}} | {{CompatGeckoDesktop("1.0")}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} |
Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | {{CompatVersionUnknown}} | {{CompatGeckoMobile("1.0")}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} |
Notes
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
- The {{HTMLElement("blockquote")}} element for long quotations.
- The {{HTMLElement("cite")}} element for source citations.
{{HTMLRef}}