Open In App

How to define the relationship between a document and the external resources?

Improve
Improve
Like Article
Like
Save
Share
Report

In this article, we learn how to create the relationship between a document and the external resources by using the <link> Element. This tag is used to define a link between a document and an external resource. The link tag is used to link to external style sheets. This element can appear multiple times but it goes only in the head section.
The link element is empty, it contains attributes only.

Syntax:

 <link rel="stylesheet" type="text/css" href="styles.css">

Example:




<!DOCTYPE html> 
<html
  
<head
    <title>Define the relationship between a 
        document and the external resources
</title
    <link rel="stylesheet"
        type="text/css"
        href="styles.css"
</head
  
<body
  
    <h1>GeeksforGeeks</h1
    <h2>HTML5: How to define the relationship 
between a document and the external resources?
</h2
  
</body
  
</html


CSS Code:




h1 {
    color: green;
}
  
h1, h2{
    text-align: center;
}


Output:

Supported Browsers:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari


Last Updated : 26 Jun, 2020
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads