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 Foundations Selectors Type, Class, and ID Selectors

barnabasadedoyin
barnabasadedoyin
1,501 Points

Don't seems to get it

Select the body of the page. Set its background color to lightblue.

and I used:

<!DOCTYPE html>
<html>
<head>
    <title>CSS Selectors</title>
    <link rel="stylesheet" href="cc1-main-styles.css" type="text/css" media="screen">
    <link rel="stylesheet" href="style.css" type="text/css" media="screen">
</head>
<body>
  <div class="main-container">
    <h1><em>Hello</em> World!</h1>
    <div>
        <p>
            <em>Lorem ipsum dolor</em> sit amet, consectetur adipiscing elit. Nunc pulvinar consequat tortor, nec venenatis erat elementum scelerisque. Curabitur sit amet risus nisi. Aenean aliquet euismod augue at viverra. Ut varius arcu in lorem iaculis ullamcorper. Integer eu rutrum quam.
        </p>
    </div>
</body>
</html>

=============================================

CSS:

.main-content {
     background-color: lightblue;
}

Bummer! Check the body selector in your CSS. Make sure background-color is set to 'lightblue'.

Where's the bummer? Please help.

2 Answers

Laura Cressman
Laura Cressman
12,548 Points

You have the right idea! Just read the instructions again-it says to select the BODY of the page, not the div. So instead of selecting .main-content, what should go there instead? the rest of your answer looks right to me :)

barnabasadedoyin
barnabasadedoyin
1,501 Points

Hello, thanks, though I got it now, seems one will need to follow the code challenge irrespective of the video tutorial samples

The challenge is asking you to select the "body" of the page. Looks like you've selected ".main-content". That's not the "body" of an HTML page. Hint: try using the word "body"

Hope this helps,

Ronald