20 Dec 2024

CSS :IS Selector

Code

article :is(h1,h2,h3) {
   color: red;
   font-weight: 600;
}

button:is(:hover, :focus, :active) {
   background-color: red;
   color: white;
}

Transcript

“The :IS() CSS selector is a powerful tool for grouping selectors, making your styles more concise and easier to maintain.

For example, you can target an article and its headings in a single line keeping your CSS tidy.

Another great example for CSS states like hover, focus and active. with :IS() you can style these states in one go, simplifying your code.

And thats it! the IS sudo class is simple, efficient and a game changer for writing clean and maintainable CSS code.

Ready to build something brilliant?

All Rights Reserved  | Copyright 2020 - 2025 Christopher Nathaniel