Class is an attribute or property of all html elements, used to apply style or css to change look and feel, this style or css can be used with multiple html elements to apply same css.
In stylesheet or in head section, class is prefixed with dot then class name without space. this class name is used with class attribute in HTML elements. Multiple classes can be used, seperated by space.
Example
<!DOCTYPE html>
<html>
<head>
<style>
.redbackground {
background-color: red;
color: black;
width: 100px;
height: 50px;
padding:20px;
}
.fsz{
font-size:50px;
}
</style>
</head>
<body>
<div class="redbackground">
class example with red background
</div>
<span class="redbackground">
class example with red background
</span>
<p class="redbackground fsz">
Multiple class example with red background and font size
</p>
</body>
</html>