The Link Tag - HTML

You can use the link tag to provide additional information on a document’s relationship to other documents, independently of whether the current document actually links to other documents or not. The link tag supports the same attributes as the anchor tag, but with a slightly different syntax:

  • The link tag does not encapsulate any text.
  • The link tag does not have an ending tag.

For example, the following code could be used in chapter10.html to define that document’s relationship to chapter9.html and chapter11.html:

<link href=“chapter.html” rel=“next” rev=“prev” /><link href=“chapter.html” rel=“prev” rev=“next” />

The link tag does not result in any visible text being rendered, but can be used by user agents to provide additional navigation or other user-interface tools.
Another important use of the link tag is to provide alternate content for search engines. For example, the following link references a French version of the current document (chapter10.html):

<LINK lang=“fr” rel=“alternate” hreflang=“fr” href=“” />

Other relationship attribute values (start, contents, and so on) can likewise be used to provide relevant information on document relationships to search engines.

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd Protection Status

HTML Topics