An href on a <link> tag specifies the URL of a style sheet or an icon.
Its value can be an internal or an external URL.
A <link> element with an href attribute.
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; }
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:
<link href="URL" />
Value | Description |
---|---|
URL | URL or path of the stylesheet or icon. |
Here is when href support started for each browser:
Chrome
|
1.0 | Sep 2008 |
Firefox
|
1.0 | Sep 2002 |
IE/Edge
|
1.0 | Aug 1995 |
Opera
|
1.0 | Jan 2006 |
Safari
|
1.0 | Jan 2003 |
Back to <link>