'What does the tag <link rel="author" .. do?

I'm currently trying to learn HTML and I have a question about the link element: <link rel="author" href="URL">. What does this element do?

My book says:

establishing a relationship between a document and an author (document).

But what does this really mean?

A visitor of my website can't see it, it is not displayed anywhere, so who or what is using this element?



Solution 1:[1]

You have to remember that HTML is a structured language that is meant to be read by machines and then used to render to something that is much more easily read by humans. A browser takes all the HTML and then uses it to know how to render a webpage. The <link>, <meta> and other tags in the <head> are read by a machine and, although they don't directly render to something that is visible to humans, they still play a part in the overall experience.

The <link> tag can be used in a number of ways by the machine piece that reads the HTML document. For example, a web crawler might read the document and present search results to you if you were to search for a specific author. If the document said that it was written by Bob Barker and you searched Google for articles written by Bob Barker, this is how it would know how to present the document to you.

Let's also say that the browser wanted to provide an easy way for you to get in touch with an author of a page, the easiest way for it to know who to put you in contact with is to read this element since its purpose is explicitly (from MDN):

Defines a hyperlink to a page describing the author or providing a way to contact the author.


That <link> tag is only one example though. One of the more current ways to express metadata is through <meta> tags. I'm not completely up to date on all the ways they are used, but consider this example:

When I search Google for "html card meta" I am presented with this article The Essential Meta Tags for Social Media as the first result:

Google results for html card meta

If you look closely, you will see that it has a date next to the article "Jun 20, 2016". That's the publication date. The only reason Google is able to reasonably discern this is because of the <meta property="article:published_time" content="2016-06-20T13:18:32+00:00"> tag in the actual source of the article page. It would have to guess from other page features otherwise.

Article meta tag

Solution 2:[2]

Using rel=author indicates that a link is pointing to information about the author of a page or article.

It establishes a link relationship between the page where it is found and the referenced document about the author.

enter image description here

To answer your question in layman's terms, consider a typical example looks like <a href="/author-page.html" rel="author">link text</a> the above code is basically saying "Here is a link to author-page.html. author-page.html is about the author of this document."

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 TylerH