HTML <q> Tag

The <q> tag is used to mark short, in-line quotations. The quotations are surrounded by double quote characters on either side.

HTML Tag

Example

#

A <q> tag that marks a quote from the novel Harry Potter.

The quote Happiness can be found even in the darkest of times if one only remembers to turn on the light by Albus Dumbledore was from the novel Harry Potter.

<p style="max-width:550px;">
   The quote <q>Happiness can be found even in the darkest 
   of times if one only remembers to turn on the light</q> 
   by Albus Dumbledore was from the novel Harry Potter.
</p>
q = quote

Using <q>

The <q> tag is an inline element for short quotations.

This element surrounds the quote with "quotation marks".

More Examples

A <q> tag with a poem by Shakespeare.

To be, or not to be, that is the question -- by William Shakespeare.

<p><q>To be, or not to be, that is the question</q> -- by William Shakespeare.</p>

Attributes for <q>

This table lists the <q> attributes.

Attribute Value Description
cite URL Quote source URL
id    identifier Defines a unique identifier for the q element.
class    classnames Sets one or more CSS classes to be applied to the q element.
style    CSS-styles Sets the style for the q element.

For additional global attributes see our global attributes list.


Browser support

Here is when <q> support started for each browser:

Chrome
1.0 Sep 2008
Firefox
1.0 Sep 2002
IE/Edge
1.0 Aug 1995
Opera
1.0 Jan 2006
Safari
1.0 Jan 2003

You may also like

Guides