Skip to content

Latest commit

 

History

History
26 lines (21 loc) · 497 Bytes

combine-styles-with-the-is-pseudo-class-selector.mdx

File metadata and controls

26 lines (21 loc) · 497 Bytes
category created tags title
Tip
2021-03-23
CSS
Combine styles with the :is pseudo-class selector

The :is pseudo-class selector applies the styles for any element that matches a selector listed in the arguments.

Rather than writing separate selectors:

header a:hover,
nav a:hover,
footer a:hover {
    text-decoration: underline;
}

We can combine them into a single one as following:

:is(header, nav, footer) a:hover {
    text-decoration: underline;
}