Filter (Advanced Search)
Downloads
0
Views
212
Video

Video is not available... Embedded is previous playlist.

Details

To create a class; write a period (.) character, followed by a class name. Then, define the CSS properties within curly braces {}:


<!DOCTYPE html>
<html>
<head>
<title>class on headers</title>
<style>
.school {background-color: tomato;color: white;padding: 10px;}
</style>
</head>
<body>
<h2>The class Attribute</h2>
<p>Use CSS to style elements with the class name "school":</p>

<h2 class="school">GSSS KHOKHAR</h2>
<p>GOVT.SEN.SEC.SCHOOL, KHOKHAR</p>

<h2 class="school">GHS HARAZ</h2>
<p>GOVT. HIGH SCHOOL, HARAZ</p>

<h2 class="school">GSSS SARAINAGA</h2>
<p>GOVT.SEN.SEC.SCHOOL, SARAINAGA</p>


</body>
</html>



Ad