HTML <link> href Attribute

The href attribute on a <link> tag specifies the URL of either a style sheet or icon. The href value can be an internal URL or an external URL.



An href attribute on a <link> element.
This link loads a stylesheet which is then used to style a paragraph.

Styled using external css.

<link rel="stylesheet" href="/tutorial/style.css">

<p class="aliceblue">Styled using external css.</p>

Here is the content of the stylesheet:

.aliceblue { background-color: aliceblue; color: steelblue; padding: 10px; }
.papaya { background-color: papayawhip; color: indianred; padding: 10px; }

Using link

The href attribute specifies the URL or path of the stylesheet or site icon.

This attribute on a <link> will load the specified stylesheet or site icon.

It accepts any of these URLs:

  • absolute URL - links to an external website or domain (e.g.
  • relative URL - links to a resource on the same website or domain (with a shorter url)


<link href="URL" />



Value Description
URL URL or path of the stylesheet or icon.

Browser support

Here is when href support started for each browser:

1.0 Sep 2008
1.0 Sep 2002
1.0 Aug 1995
1.0 Jan 2006
1.0 Jan 2003

You may also like

 Back to <link>