CSS * Selector

Complete CSS Reference Complete CSS Reference

Example

How to select all elements, and set their background color:

*
{
background-color:yellow;
}

Try it yourself »

Definition and Usage

The * selector styles all elements.

The * selector can also style all elements inside other elements:

Example

How to select all elements inside <div> elements:

div *
{
background-color:yellow;
}

Try it yourself »

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The * selector is supported in all major browsers.


CSS Version

The * selector was first introduced in:

CSS 2


Complete CSS Reference Complete CSS Reference