Get to know MDN better
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
The CSS universal selector (*) matches elements of any type.
The universal selector is a special type selector and can therefore be namespaced when using @namespace. This is useful when dealing with documents containing multiple namespaces such as HTML with inline SVG or MathML, or XML that mixes multiple vocabularies.
Note: The universal selector (*) matches elements only. It does not directly match pseudo-elements by itself.
To match all ::before pseudo-elements on a page, for example, you would have to use a selector like *::before. This works because the * matches all elements, and the ::before pseudo-element is available on all elements.
The asterisk is optional with simple selectors. For instance, *.warning and .warning are equivalent.
In this example the selector will only match elements in the example namespace.
| Selectors Level 4 # the-universal-selector |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Nov 17, 2025 by MDN contributors.
Your blueprint for a better internet.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.