In the following example we have two <span> elements with a class attribute with the value of "note". Both <span> elements will be styled equally according to the .note style definition in the head section:
Live Demo & Try it yourself!
Video is not available... Embedded is previous playlist.
In the following example we have two <span> elements with a class attribute with the value of "note". Both <span> elements will be styled equally according to the .note style definition in the head section:
<!DOCTYPE html>
<html>
<head>
<title>class on span elements</title>
<style>
.note {font-size: 120%;color: red;}
</style>
</head>
<body>
<h1>GSSS <span class="note">KHOKHAR</span></h1>
<p>Sri <span class="note">Muktsar</span> Sahib</p>
</body>
</html>