23

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?

Jordan Clark
  • 750
  • 5
  • 18
Jeff
  • 239
  • 2
  • 3
  • 1
    good question - I would place a bounty, but I don't have enough rep... –  Mar 16 '15 at 23:29

7 Answers7

18

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.

Ninjakannon
  • 3,751
  • 7
  • 53
  • 76
Naeem Shaikh
  • 15,331
  • 6
  • 50
  • 88
6

Both the <cite> tag and the cite attribute are for semantic purposes, which means that they are simply for giving a website more "meaning". For example, I could use a <div> tag for a quote, rather than using a <blockquote> tag, but this provides less meaning to the browser, and hence using <blockquote> is recommended for quotes.

The same is with the <cite> tag and cite attributes. As per the MDN definition for the cite attribute (link here):

Use the cite attribute on a or element to reference an online resource for a source.

"so who does use this information, and how?" - I believe that search engines (e.g. Google) would use this information to show potential links between documents. If you think about this it is a major point. Check out the image below:

Search of Samsung on Google

Notice how it shows the "Samsung Group" information box on the right. The guys who work at Google don't write this information - rather, it is sourced from Wikipedia. However, this information would be of greater relevance to the search "samsung" when this information is also written on other websites, with the cite attribute linking this information to Wikipedia (hence increasing the relevancy of Wikipedia). This is why Wikipedia's information is used here, and not some primary school's website regarding Samsung phones.

The cite attribute simply provides more meaning to the website. Tim Berners-Lee has described the semantic web as a component of "Web 3.0" - in other words, many components of the updating HTML language are simply to provide more meaning onto the webpage, as a step closer to Web 3.0.

TL;DR - in simpler terms, the cite attribute is just to provide more meaning to the web page, and may be used for search engines for better web linkage.

Lucas
  • 16,930
  • 31
  • 110
  • 182
  • Could you please clarify the "Notice how " paragraph? It's hard to understand. Where is the cite attribute used, on the wiki page, on the google page, or in Samsung or in other pages citing Wikipedia? Can you make it concrete? Because the rest of the answer is clear and useful. – Santropedro Jul 11 '19 at 13:15
  • @Santropedro The MDN describes it as "contain[ing] a URI which points to the source of the quote or change." which I think best summarises what the `cite` attribute does. [Link to MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes) – Lucas Jul 13 '19 at 10:30
  • Did I understood "Notice how" paragraph correctly now?: 1) When Google sees many sites talking about Samsung, are "citing" to link1: **https://en.wikipedia.org/wiki/Samsung**, by simply using the cite attribute with that link1 in their source code, then Google thinks "Well, this site seems credible and very referenced by others, so we'll use it on the information box on the right. Sidenote, I found websites quoting verbatim link1 which (sadly) DIDN'T cite="link1"! Those won't "help" wikipedia to be found by Google, at least so readily. – Santropedro Jul 13 '19 at 13:46
  • 1
    @Santropedro Yep :) the concept of linking on the Internet is the foundation of "page ranking", which is the foundation of the algorithm used by search engines to rank websites in terms of popularity and relevance. – Lucas Jul 14 '19 at 23:22
0

W3C has this to say:

The value of this attribute is a URI that designates a source document or message. This attribute is intended to give information about the source from which the quotation was borrowed.

It's not visible and I can't think of anywhere it's used except perhaps by search engines.

Flash
  • 15,945
  • 13
  • 70
  • 98
0

It is meant to be used by machine which collect and arrange data eg. search engines, but it can be used by any machine. It is meant to make webpages more systematic to be read by machine. As they can not understand which part of text represent citation and quote based on only context. you can look up Semantic Web for more information. http://en.wikipedia.org/wiki/Semantic_Web

Pradeep
  • 1,254
  • 1
  • 22
  • 41
0

Quoted from W3Schools:

The cite attribute is not supported by any of the major browsers. However, search engines may use it to get more information about the quotation.

http://www.w3schools.com/tags/att_q_cite.asp

Lucas
  • 16,930
  • 31
  • 110
  • 182
KristofMols
  • 3,487
  • 2
  • 38
  • 48
  • 5
    Sounds like wild speculation to me. Search engines 'may' use it, they say, without offering any evidence that they *do*, nor any suggestion as to what purpose it would be used *for*. Regardless, they've since removed that claim and replaced it with alternative wild speculation that the attribute *"can be used by screen readers"*. Once again, there's no evidence given that this claim is true and it's entirely non-obvious how or why a screen-reader would even want to use the attribute. – Mark Amery Mar 11 '15 at 16:28
  • If you meant to _cite_ an authoritative source, you probably meant to reference the **W3C** (**W3Schools** is most definitely not an authoritative source, and its name is intended to trick you). Here's the W3C info on the "cite" attribute: https://dev.w3.org/html5/pf-summary/text-level-semantics.html#attr-q-cite – Dem Pilafian Jun 30 '19 at 04:36
0

Yes, the source of the quotation isn't visible to end user. So it's just a reference to the source.

Definition from WHATWG.ORG:

Content inside a q element must be quoted from another source, whose address, if it has one, may be cited in the cite attribute. The source may be fictional, as when quoting characters in a novel or screenplay.

If the cite attribute is present, it must be a valid URL potentially surrounded by spaces.

Vladimir Tarasov
  • 631
  • 1
  • 7
  • 10
-1

It's just another meta data chunk that can be used by server side scripts to collect statistics or by front end developpers to add functionnalities (they can choose to print the source, allow to access the original source, etc...).

It's just a good practice to have the original source written somewhere although it is actually not very useful for the end user.

tomaoq
  • 3,028
  • 2
  • 18
  • 25