Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

HTML | <link> href Attribute

  • Last Updated : 08 Jun, 2021

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 which specifies the URL of the linked document. 
Possible values are: 
 

Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.

  • 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 the link element. 
 

html




<!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
My Personal Notes arrow_drop_up
Recommended Articles
Page :