Apart from the already traditional use to relate cascading style sheets:
<link href="style.css" rel="stylesheet"/>
is there any other use of the element <link>
that would be useful on a web page? Does the HTML5 standard shed any light on this?
Apart from the already traditional use to relate cascading style sheets:
<link href="style.css" rel="stylesheet"/>
is there any other use of the element <link>
that would be useful on a web page? Does the HTML5 standard shed any light on this?
Although, as you say,
link
it is mainly used for CSS style sheets, it also allows other types of information to be linked, depending on the value of the attributerel
. How the browser interprets it will vary depending on what type of resource it is (in some cases it will be displayed, in others it will be treated as meta-data).For example,
link
it allows to bind:Author information:
author
. I include the following code to associate the page with my Google+ profile (yes, I must be the only one using it :P):Page icon:
icon
orshortcut icon
. Makes the browser display the icon next to the page title (in the window or tab):Help information:
help
. To link to a page that will provide additional help about the page:The next page in a sequence:
next
. If you are on a page that follows an order (for example a tutorial), it allows you to indicate which page should be next. A real example taken from the NumPy web page :The previous page in a sequence:
prev
. Similar to above, but instead of the next, it points to the previous page:You can find other examples of allowed types on the MDN page .
The Link tag has different types of use that are not only used to include a style sheet (css) in a web but it is true that by default it is used to "link" to other files, documents, images, etc.
For example:
To define the favicon of a web (Icon that is seen in the browser tab, the link tag is used in the following way:
You can also use it to define the relationship between the pages and the course of the web. These are attributes that are not normally used but are endorsed and recommended by w3c.
Example:
Another use that is usually given is to define a style but not for the web but for the printing of said web.
I leave you a link where you can see a little more detailed the use of the tag, among other things " Link ".