CSS Universal Selector
Description
The * Universal selector targets every element in the document, making it one of the most powerful and far-reaching selectors in CSS. It applies styles globally unless limited by context, which makes it especially useful for resets, normalization, and broad layout adjustments. Because it does not rely on element names, classes, or IDs, it can affect everything from structural elements like div and section to inline elements such as span. When used carefully, it helps establish consistent defaults across browsers and layouts.
The * selector is often used at the start of a stylesheet to reset or normalize spacing and box behavior. A common example is applying box-sizing globally so that width and height calculations are predictable. Developers frequently combine it with properties like margin and padding to remove browser defaults before layering custom styles. For example, applying zero margin and padding universally ensures that spacing is fully controlled by your own layout rules rather than inconsistent browser defaults.
The Universal selector can also be scoped by combining it with other selectors, which helps reduce unintended side effects. For instance, using it inside a container (such as .card *) applies styles only to descendants of that element. This makes it useful for component-based styling, where you want consistent behavior inside a UI block without affecting the entire page. When paired with a class selector like .class, it becomes a powerful way to enforce internal consistency while keeping global styles clean.
It’s important to use the * selector thoughtfully, as it can have performance implications on very large documents and may unintentionally override more specific styles if not carefully structured. While it has low specificity, its broad reach means it should be used intentionally - typically for foundational rules rather than detailed styling. When used with purpose, the Universal selector becomes a reliable tool for establishing structure, consistency, and predictability across an entire website.
Syntax
* { css declarations; }
Example
Browser Support
The following information will show you the current browser support for the CSS Universal selector. Hover over a browser icon to see the version that first introduced support for this selector.
This CSS universal selector is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 2nd January 2026
