CSS Universal (*) Selector
Example
Select and style all elements:
* {
border: 2px solid green;
background-color: beige;
}
Try it Yourself »
More "Try it Yourself" examples below.
Definition and Usage
The CSS universal selector (*
) selects all elements of any type.
The universal selector (*
) can also select all elements inside another element (See "More
Examples").
This selector can also be namespaced when using @namespace.
- ns|* - selects all elements in namespace ns
- *|* - selects all elements
- |* - selects all elements without any namespace declared
Version: | CSS2 |
---|
Browser Support
The numbers in the table specifies the first browser version that fully supports the selector.
Selector | |||||
---|---|---|---|---|---|
* | Yes | Yes | Yes | Yes | Yes |
CSS Syntax
CSS Syntax with Namespace
namespace|* {
css declarations;
}
More Examples
Example
Select and style all elements inside <div> elements:
div *
{
background-color: yellow;
}
Try it Yourself »