3

I cannot comprehend this.

Using <cite> text </cite> separately like this just makes the text appear a little bite italic, but i cannot understand the purpose of cite being used as an attribute in blockquote.

For example:

<blockquote cite="http://www.example.com">

    For 50 years, WWF has been protecting the future of nature.

</blockquote> 

Now, where does this url link appear? Everywhere i look it just says "it's for reference", but reference where?

The link is not showing on the output unless I use href and <p> to make it appear.

So what exactly does this attribute cite does in this case? Where does this url appear?

Machavity
  • 30,841
  • 27
  • 92
  • 100

1 Answers1

1

As per https://www.w3.org/TR/2011/WD-html5-20110525/text-level-semantics.html#attr-q-cite

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. To obtain the corresponding citation link, the value of the attribute must be resolved relative to the element. User agents should allow users to follow such citation links.

<p>
  ... or better said by Frank,
  <q cite="https://www.goodreads.com/author/show/22302.Frank_Zappa">
      So many books, so little time.
  </q>
</p>

Since it's not a link (not something a human can follow) it's clearly for SEO purpose, but mostly for indexing. So if you take a quotation from another resource, like another websites page, a cite attribute pointing to the site you've taken that quote from - helps search engines index such resources relations.

Community
  • 1
  • 1
Roko C. Buljan
  • 196,159
  • 39
  • 305
  • 313
  • I don't understand! Can someone here just explain this to me in plain simple English - where does the cited url appear? If i don't use href or p to make it show, where does it appear? What is the purpose of citing the url??? Please explain it to me like you are explaining to a baby. –  Jun 26 '18 at 22:25
  • Ohh! Now i get it! So what was the purpose of putting this attribute on the beginners tutorial in w3school without even explaining what is the purpose of 'cite'? They could've just explain that it has nothing to do with the displayed code, and it's just for index purposes. Just wasted 2 hours of my time. Anyway, thanks a lot Roko! –  Jun 26 '18 at 22:56
  • 1
    To be fair, user agents are supposed to "allow users to follow such citation links", but since it is prefaced with "should" (not "must"), none of them do :(. – Heretic Monkey Jun 26 '18 at 22:57