CSS :is() Pseudo-class

Definition and Usage

CSS :is() Pseudo-classes are used to apply the same style to all elements within the parentheses simultaneously.

:is() Pseudo-classes require a comma-separated selector list as their parameter.

Tip:When dealing with HTML parts and headings,:is() Pseudo-classes are very useful.

See the following example:

:is(section, article) :is(h1, h2, h3, h4, h5, h6) {
  color: green;
}

Is equivalent to:

section h1, section h2, section h3, section h4, section h5, section h6, article h1, article h2, article h3, article h4, article h5, article h6 {
  color: green;
}

Example

Apply red text color to p.intro, <ul>, and <ol> elements:

:is(p.intro, ul, ol) {
  color: red;
}

Try It Yourself

CSS Syntax

:is(selector-list) {
  css declarations;
}

Technical Details

Version: CSS4

Browser Support

The numbers in the table specify the first browser version that fully supports this pseudo-class.

Chrome Edge Firefox Safari Opera
88 88 78 14 74