How to include a CSS in an HTML file

Below is my sample stylesheet created, with a name say style.css

FileĀ style.css

{code type=css}
body
{
background-color:#d0e4fe;
}
h1
{
color:orange;
text-align:center;
}
p
{
font-family:”Times New Roman”;
font-size:20px;
}

{/code}

To include the above css file in an HTML file, you need to use theĀ link tag. In the link tag using the href attribute you can specify the path and the name of the stylesheet which you want to inlcude, and the type attribute here has a value of “text/css” .

{code type=html}

<html>
<head>
<link href=”style.css” rel=”stylesheet” type=”text/css”>
</head>

<body>

<h1>This is an HTML File</h1>
<p>Check the above link statement present in the head tag .</p>

</body>
</html>

{/code}