External CSS

External css file is a separate file with extension  .css

External css file help to easily to update code

How use css file in html file

1- link css file to html file by this method

<head>

<link rel="stylesheet" href="style.css">

</head>

Example 01

1 - create html file

2-Create css file ( file name style.css)


<!DOCTYPE html>

<head>

<title>Use css external file</title>

<link rel="stylesheet" href="">

</head>

<body>

<h1>This is heading tag </h1>

<p>This is paragraph</p>

</body>

</html>

Write CSS Code in external css file

h1{

 color:red;

font-family:cursive;

}

p{

color:blue;

}

Result

This is heading tag

This is paragraph