Definition and Usage
The cite
attribute specifies a URL that references the source of a quote or change.
This attribute is used with tags such as
<q>
,
<blockquote>
,
<ins>
,
and
<del>
.
It enhances information credibility by providing source details for quotes or changes, enabling authors and search engines to utilize this information.
Basic Example
<p>
Tim Berners-Lee said:
<q cite="https://example.com/example">
The internet is a human right.
</q>
</p>
Tim Berners-Lee said:
The internet is a human right.
Applicable Tags and Uses of the cite
Attribute
<q>
|
The URL specifying the source document or message of the quoted information. |
---|---|
<blockquote>
|
The URL specifying the source document or message of the quoted information. |
<ins>
|
The URL of a resource providing information about the inserted content. |
<del>
|
The URL of a resource providing information about the deleted content. |
The cite
attribute is not a required attribute.
Its value is not displayed to users when viewing the web page. However, using the cite
attribute explicitly provides the source of a quote or change, enhancing the credibility of the information and allowing authors, web developers, and search engines to utilize this data.
Examples
Check out how the cite
attribute is used with the
<q>
,
<blockquote>
,
<ins>
,
and
<del>
tags through the following examples.
Using the cite
attribute with <q>
<p>
Here is a famous quote:
<q cite="https://www.brainyquote.com/quotes/albert_einstein_100134">
Imagination is limitless. Knowledge is limited.
</q>
</p>
Here is a famous quote:
Imagination is limitless. Knowledge is limited.
In this example, the cite
attribute on the <q>
tag provides the URL of the original source document for the quoted information.
Using the cite
attribute with <blockquote>
<p>The following is a quotation from Wikipedia.</p>
<blockquote cite="https://en.wikipedia.org/wiki/Romeo_and_Juliet">
<p>
The Tragedy of Romeo and Juliet, often shortened to Romeo and Juliet,
is a tragedy written by William Shakespeare about the romance
between two young Italians from feuding families.
It was among Shakespeare's most popular plays during his lifetime and,
along with Hamlet, is one of his most frequently performed. Today,
the title characters are regarded as archetypal young lovers.
</p>
</blockquote>
The following is a quotation from Wikipedia.
The Tragedy of Romeo and Juliet, often shortened to Romeo and Juliet,
is a tragedy written by William Shakespeare about the romance
between two young Italians from feuding families.
It was among Shakespeare's most popular plays during his lifetime and,
along with Hamlet, is one of his most frequently performed. Today,
the title characters are regarded as archetypal young lovers.
In this example, the cite
attribute on the <blockquote>
tag provides the URL of the original source document for the cited information.
Using the cite
attribute with <ins>
<p>
Here is a description of the latest update:
<ins cite="https://example.com/changelog">
Latest update details...
</ins>
</p>
Here is a description of the latest update: Latest update details...
In this example, the cite
attribute on the <ins>
tag provides the URL of the original resource page containing the latest update information.
Using the cite
attribute with <del>
<p>
The following feature has been removed:
<del cite="https://example.com/changelog">
Details about the removed feature...
</del>
</p>
The following feature has been removed:
Details about the removed feature...
In this example, the cite
attribute on the <del>
tag provides the URL of the original resource page containing details about the removed feature.
Browser compatibility
The cite
attribute has the following browser compatibility across supported tags.
Attribute |
Desktop Chrome
|
DesktopDesktop Edge
|
Desktop Firefox
|
Safari
|
---|---|---|---|---|
<q> cite
|
1 | 12 | 1 | 3 |
<blockquote> cite
|
1 | 12 | 1 | 4 |
<ins> cite
|
1 | 12 | 1 | 3 |
<del> cite
|
1 | 12 | 1 | 4 |
Specifications
Specification | |
---|---|
<q> cite
|
HTML Standard #attr-q-cite |
<blockquote> cite
|
HTML Standard #attr-blockquote-cite |
<ins>,<del> cite
|
HTML Standard #attributes-common-to-ins-and-del-elements |