Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does <link> tag do besides including stylesheets?

I know that the HTML <link> tag is used for attatching stylesheets, but looking at the W3CSchools tag reference, it has many other values for the rel attribute. I've looked all over the place, but I can't for the life of me find a place that describes in detail what the other values do and how they work. Can anyone send me to the right place or explain it themselves?

Edit: Let me rephrase my question; I know that the link tag supplies other pages that relate to the current document, but how are they used? For example, how are the first, prev, and next relationships used?

like image 257
Hussain Avatar asked Jan 17 '10 19:01

Hussain


People also ask

What are link tags used for?

Definition and Usage. The <link> tag defines the relationship between the current document and an external resource. The <link> tag is most often used to link to external style sheets or to add a favicon to your website. The <link> element is an empty element, it contains attributes only.

What is the tag for a link?

The <a> tag defines a hyperlink, which is used to link from one page to another. The most important attribute of the <a> element is the href attribute, which indicates the link's destination.

Why are HTML link tags important?

Use HTML link tags whenever you want to link externally or internally. You can use link tags to encourage external linking from other sites to your own (known as “inbound links”), and enhancing your SEO by linking to trustworthy sites (“outbound links”).


1 Answers

I know two prominent common uses:

  • With rel="stylesheet" to reference external CSS style sheets

  • With rel="favicon" to reference browser favicons

Additionally, there are

  • Forward and reverse links (rel="next")

  • Links to alternative resources for search engines (rel="alternate")

Check the W3C Reference: Links in HTML documents for details on stylesheet, and the latter two.

like image 78
Pekka Avatar answered Sep 28 '22 00:09

Pekka