HTML link Tag href Attribute Tutorial

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

What is href Attribute in HTML <link> Tag?

We use the href attribute in an HTML <link> element to set the address (URL) of the external resource we want the current document to link to.

Browsers then send a request to this address in order to get that external resource and load it in the current document.

HTML href Attribute in <link> Tag Syntax:

<link href = “external file address” rel = “rel” type = “type”>

<link> Tag href Attribute Values

The value we set for the href attribute is the address of an external resource that we want the current document to create a link with it.

Example: using href attribute in HTML <link> tag

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

Facebook
Twitter
Pinterest
LinkedIn

Top Technologies