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

challenge problem..My coding appears to work but it's not accepting it. what do i do?

I'm stuck on a css challenge. The directions are: Select the body of the page. Set its background color to lightblue.

here's the html code

<!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>
  <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>

Now, I've tried <body id="body"> with the css code #body {color: lightblue;} which does change the body of the text light blue. I've also tried <body class="body"> with css code .body {color: lightblue;} which also turns the body of the text blue. However, I keep getting "Bummer! Check the body selector in your CSS. Make sure background-color is set to 'lightblue'."

What am i doing wrong? how do i pass this challenge?

thanks for your help

3 Answers

Seth McCombs
Seth McCombs
16,767 Points

Try

body {
background-color: light-blue;
}

This will change the background color, not the text :) setting a color affects the text color, but the background-color selector should solve your problem.

John Steer-Fowler
PLUS
John Steer-Fowler
Courses Plus Student 11,734 Points

Hi Steve,

In your code, you are selecting the body as though it is a class like this:

.body { background-color: lightblue }

The body element is not a class. You can select it like this:

body { background-color: lightblue }

Hope this helps

tried your way, didn't get a pass on the challenge. thanks anyway.

Seth McCombs
Seth McCombs
16,767 Points

They're looking for a change in background-color, not just color, give it a shot!