class selector
A CSS selector that matches elements with a given class name, written with a dot such as .card.
In more detail
Classes are the everyday tool for styling components. Attribute selectors and pseudo-classes count the same as a class for specificity.
Related terms
- specificity — The weight the browser gives a CSS selector, used to decide which rule wins when two set the same property.
- ID selector — A CSS selector that matches the one element with a given id attribute, written with a hash such as #menu.
- type selector — A CSS selector that matches every element with a given tag name, such as button or p.
Taught in
- The Cascade Algorithm: Specificity, Inheritance And Source Order — Frontend Architecture & Web Platform