Dofactory.com
Dofactory.com

HTML <q> cite Attribute

The cite attribute on a <q> tag sets a reference or citation to the quote.

This value has no visual effect but is readable by JavaScript, screen readers, search engines, and more.

Example

#

A cite attribute on a <q> element: a quotation of a poem by William Shakepeare. The citation contains a URL to the source which is not visible.

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

<p>
  <q cite="https://en.wikipedia.org/wiki/To_be,_or_not_to_be">To be, or not to be, that is the question</q><br/>
  -- by William Shakespeare.
</p>

Using cite

The cite attribute specifies a URL to the reference of the quote.

The URL is not visible, but it is readable by screen readers, search engines, JavaScript code, and others.

cite accepts these URLs:

  • absolute URL - links to another website or domain (e.g. https://wikipedia.com)
  • relative URL - links to another page under the same domain

Tip: When available, include the source of the quote.


Syntax

<q cite="URL">

Values

#

Value Description
URL URL or path to a document that explains the quotation.

Browser support

Here is when cite 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

 Back to <q>

Last updated on Sep 30, 2023




Guides