:matches() CSS pseudo-class

The :matches() (formerly :any()) pseudo-class checks whether the element at its position in the outer selector matches any of the selectors in its selector list. It's useful syntactic sugar that allows you to avoid writing out all the combinations manually as separate selectors. The effect is similar to nesting in Sass and most other CSS preprocessors.

IE Edge Firefox Chrome Safari Opera iOS Safari Opera Mini Android Browser Blackberry Browser Opera Mobile Chrome for Android Firefox for Android IE Mobile UC Browser for Android Samsung Internet QQ Browser Baidu Browser
49webkit
See notes:
  • 1
56webkit
See notes:
  • 1
9.3
See notes:
  • 2
4.4webkit
See notes:
  • 1
14 52moz
See notes:
  • 3
57webkit
See notes:
  • 1
10
See notes:
  • 2
10.0-10.2
See notes:
  • 2
4.4.3-4.4.4webkit
See notes:
  • 1
4webkit
See notes:
  • 1
11 15 53moz
See notes:
  • 3
58webkit
See notes:
  • 1
10.1
See notes:
  • 2
44webkit
See notes:
  • 1
10.3
See notes:
  • 2
all 56webkit
See notes:
  • 1
10webkit
See notes:
  • 1
37o
See notes:
  • 1
57webkit
See notes:
  • 1
52moz
See notes:
  • 3
11 11.4webkit
See notes:
  • 1
5webkit
See notes:
  • 1
1.2webkit
See notes:
  • 1
7.12webkit
See notes:
  • 1
54moz
See notes:
  • 3
59webkit
See notes:
  • 1
TP
See notes:
  • 2
45webkit
See notes:
  • 1
55moz
See notes:
  • 3
60webkit
See notes:
  • 1
46webkit
See notes:
  • 1
56moz
See notes:
  • 3
61webkit
See notes:
  • 1

Notes

Most browsers support this spelled as a prefixed :-vendor-any() pseudo-class.

Links