HTML | <link> href Attribute
The HTML <link> href Attribute is used to specify the URL of the linked document.
It mostly contains the URL of the stylesheet file.
Syntax:
<link href="URL">
Attribute Values: It contains the value i.e URL whuch specify the URL of the linked document.
Possible values are:
- absolute URL: It points to another website.
- Relative URL: iT points to a file present within a website.
Example: This Example illustrates the use of href attribute in link element.
<!DOCTYPE html> <html> <head> <link id="linkid" rel="stylesheet" type="text/css" href="styles.css" sizes="16*16" hreflang="en-us"> </head> <body style="text-align:center;"> <h1>GeeksForGeeks</h1> <h2><link> href Attribute</h2> </body> </html> |
Output:

Supported Browsers: The browser supported by HTML | <link>href Attribute are listed below:
- Google Chrome
- Internet Explorer
- Firefox
- Opera
- Safari
Recommended Posts:
- HTML | <a> href Attribute
- HTML | <base> href Attribute
- HTML | <area> href Attribute
- How to get an element by its href attribute ?
- HTML | DOM Base href Property
- HTML | DOM Area href Property
- HTML | DOM Anchor href Property
- HTML | DOM Location href Property
- HTML | DOM Link href Property
- Node | urlObject.href API
- AngularJS | ng-href Directive
- HTML | rel attribute
- HTML | <img> alt Attribute
- HTML | <img> src Attribute
- HTML | max attribute
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



