HTML / HTML Attributes

HTML Cite Attribute

Dec 12, 2022
4 min read
HTML cite Attribute

Definition

The cite attribute’s usage depends on its element. For instance, it could represent the URL of the source of a quotation or an URL or URL fragment pointing to the reasons for inserting or deleting text.

Applicable Elements

The cite Attribute can be used with the following elements:

HTML <blockquote> cite Attribute

The <blockquote> tag indicates that the enclosed text is a quote.

When used with the <blockquote> element, the’ cite’ attribute specifies an URL to the quote source.

Syntax

<blockquote cite="https://www.example.com/source/">Quote</blockquote>

Usage

  • The cite attribute is used to indicate the URL of the source of the quote.
  • The cite attribute value is not displayed as it is primarily intended for server-side scripts to use and process.

Values

Values can include:

  • The URL of the quote source.

Examples

A <blockquote> element showing the source URL of the quote, along with quoted text using quotation marks to delineate between the quoted text and annotation.

<figure>
    <blockquote cite="https://www.imdb.com/title/tt0075148/">
        <p>"Life's not about how hard of a hit you can give... "</p>
        <p>And this is where it gets good, he continues:</p>
        <p>"it's about how many you can take, and still keep moving forward."</p>
    </blockquote>
    <figcaption>- Sylvester Stallone, <cite>Rocky Balboa</cite></figcaption>
</figure>

HTML <del> cite Attribute

The <del> tag indicates the content has been removed from the document. Browsers will display the <del> element with a line running through it.

The cite attribute is used to specify the URL or fragment of a document stating the reason the text was deleted.

Syntax

<del cite="#deletion1">deleted words</del>

Usage

  • The cite attribute is used to specify the URL or fragment of a document stating the reason the text was deleted.
  • The URL specified is relative to the document.
  • The cite attribute value is not displayed as it is primarily intended for server-side scripts to use and process.

Values

Values can include:

  • An URL or fragment pointing to a document that provides the reason for deletion.

Examples

The example shows deleted text with an URL fragment pointing to text on the same page that explains its deletion.

<p>There are some <del cite="#deletion1">deleted words</del> in this paragraph</p>
<p id="deletion1">Reason for deleted words goes here.</p>

HTML <ins> cite Attribute

The <ins> tag indicates the content has been inserted into the document. Browsers will display the ins element as underlined.

The cite attribute is used to specify the URL or fragment of a document stating the reason the text was inserted.

Syntax

<del cite="#inserted1">Inserted words</del>

Usage

  • The cite attribute is used to specify the URL or fragment of a document stating the reason the text was inserted.
  • The URL specified is relative to the document.
  • The cite attribute value is not displayed as it is primarily intended for server-side scripts to use and process.

Values

Values can include:

  • An URL or fragment pointing to a document that provides the reason for insertion.

Examples

The example shows deleted text with an URL fragment pointing to text on the same page that explains its deletion.

<p>
There are some <ins cite="#inserted1">inserted</ins> words in this
paragraph
</p>
<p id="inserted1">Reason for inesrted words goes here.</p>

HTML <q> cite Attribute

The <q> tag indicates that the enclosed text is an inline quote. It may contain a cite attribute with a link to the source.

The cite attribute, when used with the <q> element, specifies an URL to the quote source.

Syntax

<q cite="https://www.example.com/source/">Quote</q>

Usage

  • The cite attribute is used to indicate the URL of the source of the quote.
  • The cite attribute value is not displayed as it is primarily intended for server-side scripts to use and process.

Values

Values can include:

  • The URL of the quote source.

Examples

A <q> shows an inline quote citing the source URL of the quote:

<p>The Webmaster said <q cite="https://www.thewebmaster.com">We're here to help you master the web</q>.
I agree with that statement.</p>

Specification

The cite HTML specification for each of the following elements is below:

Browser Support

The cite attribute has the following browser support:

Desktop

ChromeEdgeFirefoxIEOperaSafari
<blockquote>YesYesYesYesYesYes
<del>YesYesYesYesYesYes
<ins>YesYesYesYesYesYes
<q>YesYesYesYesYesYes

Mobile

Android WebviewChrome AndroidFirefox AndroidOpera AndroidiOS SafariSamsung Internet
<blockquote>YesYesYesYesYesYes
<del>YesYesYesYesYesYes
<ins>YesYesYesYesYesYes
<q>YesYesYesYesYesYes