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

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

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