Style Classes

Style Classes

Posted on Updated on

In Style Classses method, you can create styles in the form of style classes in external or embedded style sheets. To apply a style defined in a style class to an HTML element, you can assign the class attribute of the HTML element to the name of the style class.

There are two types of classes

1)      Universal style class

2)      Element specific class




<title>Style classes</title>


body{ background-color:#f0f8ff}

th.color {background-color:#800000}





<table border=”1″>

<caption><h2>Student Details</h2></caption>

<th class=”color”>Name</th>

<th class=”color”>Date of Birth</th>

<th class=”color”>Address</th>


<td class=”green”>sumit Saxena</td>

<td class=”green”>15/3/1983</td>

<td class=”green”>Mumbai</td>



<td class=”green”>Amitabh Kumar</td>

<td class=”green”>22/02/1984</td>

<td class=”green”>chennai</td>



<td class=”green”>Rohit Jindal</td>

<td class=”green”>5/7/1983</td>

<td class=”green”>Delhi</td>






Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: