Examples of <link> tag in a HTML using different 'rel' attributes?

Could someone provide meaningful examples of HTML <link> tag with different values of "rel" attribute?

Apart from the possible values explanation for the "rel" attribute, are there any practical uses for the different values (other than stylesheet value)?

Answers


To get a number of useful examples, I would recommend looking here: http://www.w3.org/TR/html4/struct/links.html.

This looks like a very concise, slightly easier to navigate version of w3: http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#rel-alternate


There aren’t that many meaningful real-life examples of link elements, apart from rel=stylesheet. There are various lists of rel values that might be used, with definitions and ideas of how they might be used by browsers or search engines, but little actual evidence of such use. But some elements that have real effects in some cases are:

<link rel=icon ...> defines a shortcut icon for the page; widely recognized by browsers and user by authors

<link rel=alternate ...> is described in Google instructions, so Google presumably does something with it

<link rel=canonical ...> suggested in other Google instructions

<link rel=prefetch ...> causes the referenced page to be preloaded, in some browsers


At http://reference.sitepoint.com/html/link/rel they state

The "alternate" attribute value may also be used in the context of XML feeds, namely RSS or Atom, which are indicated with the type attribute

Also, site navigation with rel="first|last|prev|next" is supposed to make navigation easier and is e.g. used by a specific firefox extension (https://addons.mozilla.org/de/firefox/addon/site-navigation-bar/?src=search).


I Only know 'icon' value, you can set pavicon of your HTML page that appear on browser tab, using:

<link rel="icon" type="icon" href="path/to/youricon.ico" />

hopely useful: http://www.w3schools.com/tags/att_link_rel.asp


examples:

<link rel="stylesheet" href="style.css"> <link rel="icon" href="image.png"> <link itemprop="URL" href="http://..."> <link rel="next" href="page3.php"> <link rel="author license" href="author_license.php"> <link rel="icon" href="favicon.png">

more examples: link element and rel attribute on link element


Need Your Help

Uninstall vagrant on Mac

macos vagrant osx-elcapitan

I want to uninstall Vagrant on a mac running El Capitan.

Fixed vertical navigation menu with dynamically changing menu buttons

javascript jquery html css ajax

I have created a theme for my website with a Fixed vertical navigation menu on the right hand side of the webpage to aid the users to scroll to different sections of the website. Now, these navigat...