Example of Class in CSS

Example of Class in CSS HTML CODE

<html>
<head>
<title> Css Classes</title>
<link rel=”stylesheet” type=”text/css” href=”sample.css”>
</head>
<body>
<h2> Responsibility assignmed to Houses</h2>
<p> Houses assigned duty for school festival : </P>
<UL>
<li> <a href=”gandhi.html” class=”festival”>Mahatma Gandhi </a> </li>
<li> <a href=”bose.html” class=”festival”>subhash chandra bose </a> </li>
</ul>
<p> Houses assigned duty for school Competetion : </P>
<UL>
<li> <a href=”nehru.html” class=”interschool”>Jawahar lal nehru</a> </li>
<li> <a href=”patel.html” class=”interschool”>Sardar vallabh bhai patel </a> </li>
</ul>
<p> Interested students are supposed to contat <a href=”lata.html”>mrs. Lata tikadar</a>
</body>
</html>

Example of Class in CSS CSS Code

a {color: blue; font-size:12pt}
a.festival {
font-family: georgia; color: gray;
}
a.interschool {
font-family: trebuchet ms; color: red;
}

Instructions to Run Example of Class in CSS HTML CODE Output​

Copy the code and paste it in the Notepad.

Save the HTML Code File with name respo.html

Save the CSS file sample.css in same folder.

Run the respo html file and look at the output Given Below.

(HTML CSS for Grade 10)

Example of Class in CSS HTML CODE Output

Example of Class in CSS HTML CODE Output​

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top