HTML link Tag type Attribute Tutorial

In this section, we will learn what the type attribute is and how to use it.

What is type Attribute in HTML <link> Tag?

With the `type` attribute, we can set the media type of the target document set in the `href` attribute.

This type then helps browsers to know how to deal with the target document (interpretation and display)

For example, if the type of the target document is CSS, then we set the value of this attribute to “text/css”.

HTML type Attribute in <link> Tag Syntax:

<link href = “document address” type = “document type”>

<link> Tag type Attribute Values

Depending on the type of the target document, we can choose one of the values listed in the media type

Example: using type attribute in HTML <link> tag

See the Pen using type attribute in HTML <link> tag by Omid Dehghan (@odehghan) on CodePen.

Facebook
Twitter
Pinterest
LinkedIn

Top Technologies