What is a Class Selector?
A class selector is used to style one or multiple HTML elements by applying the same class name.
Classes let you reuse styling rules across different elements on a webpage.
How to Write a Class Selector in CSS
A class selector starts with a dot ( . ) followed by the class name:
Example:
How to Apply a Class in HTML
Use the class="" attribute inside an HTML tag:
✔ Both elements will get the same styling
✔ You can apply the same class to unlimited elements





