Code Highlights logo

Learn

Selectors

Universal selectors

The Universal Selector * selects all the elements on the page. It is the simplest of all the selectors and has the lowest specificity. It is rarely used alone except in CSS reset styles.

Here's an example of how to use the Universal Selector to set a margin and padding of 0 for all elements:

1* {
2 margin: 0;
3 padding: 0;
4}

Instructions

1.

Add a universal selector to set a font-size property to 18px for all elements

2.

Add a universal selector to set a font-family property to Arial, sans-serif for all elements

Sign up to start coding

Already have an account?

Sign In

Course content