Skip to: content, navigation

by Ian Lloyd

q (HTML element)

Spec
Depr. Empty Version
No No HTML 4
Browser support full matrix
IE7 FF1+ Saf1.3+ Op9.2+
None Partial Partial Partial

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.

Figure 1. q in action Example of q element

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

IE5.5None
6.0None
7.0None
Firefox1.0Partial
1.5Partial
2.0Partial
Safari1.3Partial
2.0Partial
3.0Partial
Opera9.2Partial
9.5Partial

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.

In this Section

Related Reading

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.

Related Products

The Principles of Beautiful Web Design

Best Seller!

You don’t need to go to Art School to design great looking web sites!

Book Cover: The Principles of Beautiful Web Design

Download the FREE sample chapters