Dhairya Shah
Dhairya Shah's Blog

Dhairya Shah's Blog

How to link CSS to HTML - Linking CSS Stylesheet

How to link CSS to HTML - Linking CSS Stylesheet

Dhairya Shah's photo
Dhairya Shah
·Sep 2, 2022·

1 min read

Subscribe to my newsletter and never miss my upcoming articles

Play this article

HTML is a markup language that helps create the structure of the website. Thus, CSS is what we require in order to style our website.

To use CSS styling it needs to be linked with an HTML file.

To link CSS to HTML, we need the use of a link tag with some required attributes. Here's how it will go:

<link rel="stylesheet" href="style.css">
  • rel attribute in the link tag specifies the relationship between the current document and the linked document.
  • href attribute in the link tag specifies the location of the CSS file.

Thanks for reading

Follow me on Twitter

Thanks for reading!

 
Share this