Web - Classes
Code Life
By Pierre Marsaa
Introduction to Class Selectors
Class selectors allow you to target specific elements by assigning them a class name. Unlike element selectors that target all elements of a particular type, class selectors only target elements that have been assigned that class.
In CSS, class selectors start with a period (.) followed by the class name:
Loading editor...
To use a class in HTML, you add the class attribute to elements:
Loading editor...
The big advantage of classes is that you can apply the same styles to different HTML elements, and you can also choose which specific elements get those styles, unlike element selectors that affect all elements of that type.
Class Naming Rules
Class names can contain letters, numbers, hyphens, and underscores, but must start with a letter.
They are case-sensitive, so ".Button" and ".button" are considered different classes. Avoid spaces in class names - use hyphens or camelCase instead.
Verify