The <cite> tag is used in HTML to indicate a reference to a source or citation.
It allows you to mark a title of a work, a publication, or another type of source that has been cited in the content.
It should not be used to frame a complete citation with information about the author, for example: in this case, it is preferable to use <q> or <blockquote>.
Structure and syntax of the <cite> tag
Basic structure and syntax
The <cite> tag is a container tag that has:
- An opening tag:
<cite>; - A closing tag:
</cite>.
It should be used to indicate a source of citation, such as a book title, an article, a film, etc.
Usage example
Here is a practical example:
<p>The theory of relativity was formulated by Albert Einstein, according to <cite>Einstein, A. (1915). The general relativity. Annalen der Physik.</cite></p>In this example, the <cite> tag is used to specify the source of a citation (a scientific work).
The content of this tag, itself, represents the reference to the cited source.
Attributes
The <cite> tag accepts classic HTML attributes, such as title, class, or id, but it does not have specific attributes.
Difference with other similar tags
<q>: The<q>tag is used for citations, generally by enclosing the cited text in a passage without necessitating a block separation.<blockquote>: The<blockquote>tag is used to cite a long passage or a block citation, often with supplementary information about the source, whereas<cite>is mainly used to indicate the source of the citation.
Browser compatibility
The <cite> tag is supported by all modern browsers.
| Browser | Compatibility |
|---|---|
| Chrome | Yes |
| Firefox | Yes |
| Safari | Yes |
| Edge | Yes |
| Internet Explorer | Yes |