Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What rel values have concrete benefits in a <link> tag?

Tags:

html

hyperlink

The <link> tag is most commonly used to associate stylesheets with HTML documents, but as many know, it has a myriad of other uses as well. In general it represents some relationship between two documents. Its beauty and curse is that anyone can make their own rel values (relationship types) if they wish so. W3C has listed some possibilities, other people have invented even more, and if I want to there's nothing stopping me from adding a <link rel="unicorns>" to my webpage. It will even validate.

However adding random <link> tags to a webpage only wastes bandwidth. What I want to know which rel values actually provide some functionality. And not just some hypothetical functionality that some future user agent might implement, but actual concrete benefits that my users can feel today.

A few that I already know are:

  • stylesheet - the most common use, of course. Attaching CSS stylesheets.
  • canonical - instructs Google (and other search engines) where the "normal" or "canonical" URL of the page is (in case you can view the same page by many URLs);
  • icon - specifies the favicon which browsers show in the URL bar and next to bookmarks.
  • home, index, contents, search, glossary, help, first, start, prev, previous, next, last, up, copyright, author - These appear in Opera's navigation bar and (I'm told) in SeaMonkey plugin for Firefox. Additionally, Firefox preloads in background the <link rel="next"> page and Opera navigates there when you press SPACE at the bottom of current page. I believe I might have seen them in Opera Mini as well, but I'm not sure (does anyone know how these affect mobile browsers?)
  • pingback - used to implement Pingback in blogs.

Are there any other possible <link> tags that actually do something? (Please also include what they do in your answer)

like image 645
Vilx- Avatar asked Feb 26 '23 20:02

Vilx-


1 Answers

"alternate", at least as a modifier to "stylesheet" does something, in that the stylesheet will initially be in the "disabled" state.

like image 106
Alohci Avatar answered Mar 11 '23 00:03

Alohci