Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the cite attribute for?

Tags:

The cite attribute specifies the address of the source of the quoted text, I think, but who uses this information?

For example:

<q cite="http://www.example.com/quote">
<p>&#8220;A quote&#8221;</p>
<footer>&#151;Person quoted</footer>
</q>

The source of the quoted text isn't visible to the end-user in a normal browser, so who does use this information, and how?

like image 509
Jeff Avatar asked Jun 11 '11 14:06

Jeff


1 Answers

First, it's not only blockquote where you can use the cite attribute. You can use the cite attribute on the following elements also:

<blockquote>
<del>
<ins>
<q>

Why would one use cite in above elements?

To point to where the content is taken from, or change or deletion is referred.


Here is what w3.org says,

User agents may allow users to follow such citation links, but they are primarily intended for private use (e.g: by server-side scripts collecting statistics about a site's edits), not for readers


Now, the question, who uses it?

The cite attribute is used to identify the online source of the quotation in the form of a URI (for example, "http://sourcewebsite.doc/document.html").

The value of the cite attribute isn't rendered on screen (although this potentially useful meta data could be extracted and written back into the webpage through the magic of DOM Scripting).

As such, browser support for this attribute is marked as none, but because it has other potential uses (for search engine indexing, retrieval via DOM scripting, and more) and there is the likelihood of improved native support being provided for the attribute in future browser versions, you should use the cite attribute when you use the above elements.

So, currently no one uses it, but in future maybe used in user-agent or my search engines, so better to use it.

like image 120
Naeem Shaikh Avatar answered Nov 12 '22 06:11

Naeem Shaikh