HomeReferencesHTML Tags

HTML Tag: link

Defines a link to an external resource. It is most commonly used to link a CSS file to an HTML document.

link must appear within the head element.

HTML Dog, The Book HTML Dog book cover

HTML Dog is hosted by Titan Internet

Required Attributes

  • None.

Optional Attributes

  • href can be used to specify the target of a link.
  • charset can be used to specify the character set of the target of a link.
  • hreflang can be used to specify the language (in the form of a language code) of the target of a link. It should only be used when href is also used.
  • type can be used to specify the MIME type of the target of a link.
  • rel can be used to specify the relationship of the target of the link to the current page.
  • rev can be used to specify the relationship of the current page to the target of the link.
  • media can be used to specify which media the link is associated to. A value such as screen, print, projection, braille, speech or all can be used or a combination in a comma-separated list.
  • Common attributes

Example

<link rel="stylesheet" type="text/css" href="default.css" />