Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / HTML

HTML element: cite

The work-title element marks the name of a cited creative work, ranging from a book or film to a web page or computer program.

Version: WHATWG HTML Living Standard; index snapshot date recorded separately

Syntax

<cite><a href="work-url">Title of the work</a></cite>

cite contains the title of a work, not the quotation itself; blockquote and q represent a quoted section and an inline quotation respectively.

A cite attribute on a quotation is source-URL metadata, not this element. A visible link to the work uses an ordinary a with href inside or beside the title.

A person’s name alone is not a work and does not belong in cite. Default italics are merely styling; em means stress and i an alternate voice or term.

The example reads the title through textContent, uses contains() to confirm that the author is outside the work title, and observes the element’s tagName.

Examples

<!doctype html>
<meta charset="utf-8">
<base href="https://example.test/library/">
<p>Read <cite id="work"><a href="parser-notes">Parser Notes</a></cite> by <span id="author">Ada Example</span>.</p>
<output id="result"></output>
<script>
const work = document.querySelector("#work");
const author = document.querySelector("#author");
const link = work.querySelector("a");
document.querySelector("#result").textContent = `title=${work.textContent}; href=${link.href}; authorInside=${work.contains(author)}; tag=${work.tagName}`;
</script>

Result

title=Parser Notes; href=https://example.test/library/parser-notes; authorInside=false; tag=CITE

The result verifies the title, resolved URL, and separate author; it does not verify the existence or authorship of the referenced work.

Sources