Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS CSS Basics Understanding Values and Units Pixel Units

what does the css html selector target for example html {}

So I am learning CSS and I have seen the body and even universal selector being in use, I am not seeing what the HTML selector does or what it targets can anyone explain in detail.

1 Answer

Axel Mebis
Axel Mebis
11,066 Points

Just the same way as other selectors like for instance the body selector selects the <body> tag, the HTML selector selects the <HTML> tag. When you use the universal selector (the *), it selects 'all' elements, so not only the HTML tag but also all other elements on the page. It's a wildcard.