Skip to content
Related Articles

Related Articles

Improve Article

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

  • Last Updated : 26 Jun, 2020

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

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




My Personal Notes arrow_drop_up
Recommended Articles
Page :