CSS :is() Pseudo-class
Example
Apply a red text color for p.intro, <ul> and <ol> elements:
:is(p.intro, ul, ol) {
color: red;
}
Try it Yourself »
Definition and Usage
The :is()
pseudo-class
is used to apply the same style to all the elements inside the
parentheses, at the same time.
The :is()
pseudo-class requires a
comma-separated selector list as its argument.
Tip: The :is()
pseudo-class
can be very useful when dealing with HTML sections and headings.
Look at the following:
:is(section, article) :is(h1, h2, h3, h4, h5, h6) {
color: green;
}
Is equal 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;
}
Version: | CSS4 |
---|
Browser Support
The numbers in the table specifies the first browser version that fully supports the pseudo-class.
Pseudo-class | |||||
---|---|---|---|---|---|
:is() | 88 | 88 | 78 | 14 | 74 |
CSS Syntax
:is(selector-list) {
css declarations;
}