q (HTML element)
Example
Here’s an example of
the q element in use:
<p>Heck, even Bill Gates is quoted as saying <q>We need
Microformats,</q> which can only be a good thing for the cause.</p>
- Type
- inline element
- Contains
- inline elements only
- Contained by
- block-level elements, inline elements
Description
The
q element is little brother (or sister) to the
blockquote element. Where
blockquote creates a distinct block of quoted text, the
more svelte q element is used for inline quotations.
It’s intended that the browser should insert the necessary quotation
marks, the style of which should depend on the language of the document or
that section of the document, rather than the author adding quotation
marks, which can cause double quotation marks to appear.
The example code above would render as shown in Figure 1.
q in action
Use This For …
This element is
used to mark up a quotation, possibly with attribution in the form of a
cite attribute, although this is
optional.
Compatibility
| IE | 5.5 | None |
|---|---|---|
| 6.0 | None | |
| 7.0 | None | |
| Firefox | 1.0 | Partial |
| 1.5 | Partial | |
| 2.0 | Partial | |
| Safari | 1.3 | Partial |
| 2.0 | Partial | |
| 3.0 | Partial | |
| Opera | 9.2 | Partial |
| 9.5 | Partial |
The
q element doesn’t cause any discernible change in the
style of text in any browser tested, but it does add the necessary
quotation marks in all the browsers that were tested (with the exception
of Internet Explorer). The support tables show partial rather than full
support because of the browsers’ failure to reveal the information
contained in the cite
attribute.
User-contributed notes
There are no comments yet.
Add a note
To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.

