. . .

How to add a CSS file to your website or html?

Linking as a css file

We can add a css using <link> tag and href with the css file path.

<link rel="stylesheet" type="text/css" href="your_css_file.css" media="screen" />

Embedding CSS into the HTML

<style media="screen" type="text/css">

Add css code here

</style>

Adding Inline CSS to HTML tags

<h2 style="color:red;background:black;">This text is a red heading with a black background</h2>

Importing a CSS file from within CSS

@import "your_css_file.css";
Please share the article
Posted in CSS

Leave a Reply

Your email address will not be published. Required fields are marked *

16 + 6 =