How to use Cascading Style Sheets

CSS files can be written using any text editor like notepad , wordpad. An CSS style file is created with”.css” extension. The HTML file which wants to use this style has just give reference to file.

Now we will create a style sheet and then use it in an HTML file

p { color:red ;}
h4 { color:blue; }

Type the above text in using notepad and save it as ParaStyle.css

<html>
<head>
<link type=”text/css” rel=”stylesheet” href=”ParaStyle.css”>
</head>
<body>
<p>
I’m blue paragraph.
</p>
<h4>
I’m a red h4 HEADING
</h2>
</body>
</html>

In this exapmle both HTML and CSS files are in same folder. In case CSS file is in different folder a refernce to that location must be given