Open In App

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

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:


Article Tags :