CSS * Selector


Example

Select all elements, and set their background color to yellow:

* {
    background-color: yellow;
}

Try it yourself »

More "Try it Yourself" examples below.


Definition and Usage

The * selector selects all elements.

The * selector can also select all elements inside another element (See "More Examples").

Version: CSS2


Browser Support

The numbers in the table specifies the first browser version that fully supports the selector.

Selector
* 4.0 7.0 2.0 3.1 9.6


CSS Syntax

* {
    css declarations;
} Demo


Examples

More Examples


Example

Select all elements inside <div> elements and set their background color to yellow:

div * {
    background-color: yellow;
}

Try it yourself »



Color Picker

colorpicker