CSS Selectors
All HTML elements are selectors

We've used a number of HTML elements as CSS selectors so far: we've styled the HTML tags <h1></h1> with the CSS selector h1, <p></p> with p, and so on.

You may have guessed this, but if not, we'll say it outright: any HTML element can be a CSS selector! You can modify <ul>s, <table>s, and even the entire <body> by selecting ul, table, and body, respectively.


Give it a whirl! Change the entire HTML body's background-color to #C6E2FF.

Stuck? Get a hint! Hint
Get live, fast support from Codecademy Advisors when you get stuck. Learn more.

You can target the <body> just like any other HTML element:

body {
    /*CSS stuff!*/
View Preview