CSS * Selector

Select all elements, and set their background color to yellow

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

More Examples

Example

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

div * {
    background-color: yellow;
}