Clean β’ Professional
Modern CSS introduced functional pseudo-classes that help you target elements more efficiently. These selectors make complex styling rules simpler and more readable. Letβs explore each one in detail:

:is() Selector:is() pseudo-class allows you to group multiple selectors into one rule.:is().Example :
Style all headings and paragraphs inside a section with one rule.
section :is(h1, h2, h3, p) {
color: #333;
font-family: Arial, sans-serif;
}
:where() Selector:where() selector works like :is(), but the big difference is specificity.:where() has zero specificity, meaning it wonβt override other rules.Example :
Apply margin reset to multiple elements without increasing specificity.
:where(h1, h2, h3, p) {
margin: 0;
padding: 0;
}
:has() Selector:has() pseudo-class is sometimes called the βparent selectorβ in CSS.:has(), CSS couldnβt look βupwardβ (from child to parent). Now, we can style a parent only if it contains something specific.Example :
Style a card only if it has an image inside.
.card:has(img) {
border: 2px solid green;
background: #f9fff9;
}
:not() Selector:not() pseudo-class excludes elements from being styled.Example :
Style all list items except the first one.
li:not(:first-child) {
color: gray;
}
Advanced CSS Selectors
β
βββ :is() β Groups multiple selectors into one
β
βββ :where() β Groups selectors with zero specificity
β
βββ :has() β Selects a parent if it contains specific children
β
βββ :not() β Excludes elements from selection