htmlattributesblockquote

What is the purpose of the blockquote attribute ''cite'' in html?


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?


Solution

  • 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.