The <link> tag defines a link between a document and an external resource.
The <link> element is an empty element, it contains attributes only. This element goes only in the head section, but it can appear any number of times.
Attribute | Value | Description |
crossorigin | anonymous use-credentials | Specifies how the element handles cross-origin requests |
href | URL | Specifies the location of the linked document |
hreflang | language_code | Specifies the language of the text in the linked document |
media | media_query | Specifies on what device the linked document will be displayed |
rel | alternate archives author bookmark external first help icon last license next nofollow noreferrer pingback prefetch prev search sidebar stylesheet tag up | Required. Specifies the relationship between the current document and the linked document |
sizes | Height X Width any | Specifies the size of the linked resource. Only for rel=”icon” |
type | media_type | Specifies the media type of the linked document |
html code
<!DOCTYPE html>
<html>
<head>
<title>
link with css
</title>
<link rel="stylesheet" href="css/this is css.css">
</head>
<body class="design">
<h1> link tag </h1>
<p>
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Eos quibusdam obcaecati fugit sunt accusantium placeat maxime enim suscipit voluptate nam.
</p>
</body>
</html>
css code
.design{
background-color: aqua;
border-radius: 20px;
text-align: center;
border-style:solid ;
}
h1{
color:yellow;
}
p{
color:beige;
}