Categories
CSS & HTML Tips

How to use the HTML cite tag and the cite attribute?

There are at the same time a <cite> tag and a cite attribute in HTML. How does one correctly use them?

<q> is for inline quotations, such as when you need to quote a few words, half a sentence or a phrase from someone.

<blockquote> is for large chunks of text quotations, usually displayed as a block in CSS.

<cite>, doesn’t contain any quoted content but the quote author. For example,

<p>According to <cite>Einstein</cite>, <q>space can be bent</q>.</p>

Yep, that’s the correct use of the cite tag.

The cite attribute or property for <q> and <blockquote>, as in,

<blockquote cite="https://www.kavoir.com/">
<p><cite>, doesn’t contain any quoted content but the quote author.</p>
</blockquote>

Is for listing the source of the citation.

By Yang Yang

Hello, I'm Yang. I build online businesses that please people. Want to join in and post some useful articles on Kavoir.com? Shoot me a message.

4 replies on “How to use the HTML cite tag and the cite attribute?”

Would you use the cite tag or the cite attribute for the author and page number of a printed source? For example:

According to Einstein space can be bent (p. 3 Theory of Relativity).

or

According to Einstein space can be bent.

or something different?

Quite right, apocalyptiq.

I love the part where the W3C article on the correct usage of the cite tag states: “A person’s name is not the title of a work — even if people call that person a piece of work …” 🙂

Comments are closed.