DEV Community

Youn
Youn

Posted on

HTML cite Attribute – Referencing the Source URL

😄 This post is based on the content from coding.courses.

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>
Enter fullscreen mode Exit fullscreen mode

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>
Enter fullscreen mode Exit fullscreen mode

# 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>
Enter fullscreen mode Exit fullscreen mode

# 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>
Enter fullscreen mode Exit fullscreen mode

# 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>
Enter fullscreen mode Exit fullscreen mode

References

HTML cite Attribute – Referencing the Source URL - codingCourses

The cite attribute specifies the source URL of a quote or change, and is used in q, blockquote, ins, and del tags. It helps authors and search engines understand the source of the quoted or modified content.

favicon coding.courses

Top comments (0)