Arteqo Consulting

The European Web Agency

Design, brand and digital development


×

Arteqo Consulting Services

Contact Arteqo

×
I have read and accept the terms and conditions

link tag

The link tag, which, when implemented in the code, is written like this - <link>, is an HTML tag that belongs to link tags. Link HTML tags are used to define hyperlinks and their groups - tools that are used to navigate through the parts of a pages, different pages of a website or connect different websites.

<link> links the current document to any other document, e.g. a stylesheet. This tag is supported in the current version of HTML, which is HTML5.

Browser support

Here you can see whether <link> is supported by a certain browser, and, if yes, starting from which version it is supported.

Browser support for <link>
ChromeFirefoxEdgeOperaSafari
Is supportedIs supportedIs supportedIs supportedIs supported

Attributes and values

An attribute is a piece of additional information about a tag. While tags denote the type of objects they mark or create, attributes set the parameters of these objects. These parameters can include anything from the types of possible interactions to its visual style to its actual contents.

Values indicate how a certain attribute is actually implemented, if there is a number of ways it can happen.

What attributes are actually allowed in a certain tag depends on the tag itself. Much like possible attributes depend on a tag, possible values depend on an attribute.

The <link> tag supports the following attributes (with their respective values):

AttributeValueDescription
charsetchar_encodingSpecifies the character encoding of the linked document
(Not Supported in HTML5)
crossorigin
  • anonymous
  • use-credentials
Specifies how the element handles cross-origin requests
hrefURLSpecifies the location of the linked document
hreflanglanguage_codeSpecifies the language of the text in the linked document
mediamedia_querySpecifies on what device the linked document will be displayed
rel
  • alternate
  • author
  • dns-prefetch
  • help
  • icon
  • license
  • next
  • pingback
  • preconnect
  • prefetch
  • preload
  • prerender
  • prev
  • search
  • stylesheet
Required. Specifies the relationship between the current document and the linked document
revreversed relationshipSpecifies the relationship between the linked document and the current document
(Not Supported in HTML5)
sizesHeightxWidthanySpecifies the size of the linked resource. Only for rel="icon"
target
  • _blank
  • _self
  • _top
  • _parent
  • frame_name
Specifies where the linked document is to be loaded
(Not Supported in HTML5)
media_typemedia_typeSpecifies the media type of the linked document

Global Attributes

Global attributes are HTML tag attributes that can be used by any tag, hence the name "global". They are in contrast to unique attributes that are tag-specific.

<link> supports global attributes.

Event Attributes

Event attributes are HTML tag attributes that allow triggering actions upon specific conditions, hence the name "event". Other types of attributes, namely global and unique attributes, can also trigger actions, but the difference is that even attributes allow calling scripts, such as JavaScript functions, while most other attributes only support a certain type of action.

<link> supports event attributes.