HTML Classes
Use class to style many elements the same way. One of the most important HTML skills.
David Miller
December 15, 2025
4.7k125
class is used to label multiple elements with the same group name.
Example HTML
<h2 class="title">Tickets</h2>
<p class="info">Open: 12</p>
<p class="info">Resolved: 20</p>
Example CSS
.title { color: darkblue; }
.info { font-size: 18px; }
Preview
Tickets (dark blue)
Open: 12 (bigger text)
Resolved: 20 (bigger text)
Important rule
Many elements can share the same class.
#HTML#Beginner