CSS, How to use Universal Selectors

Thursday, 6. August 2009

Universal selectors are used to select any element. For example , to set the margins and padding on every element to 0, * can be used.

*{
margin: 0;
padding: 0;
}

Universal selectors also can be used to select all elements within another elements. The code below will select any element inside the <p> element.

p * {
color: red;
}