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

Dani Dayan
Dani Dayan
1,951 Points

CSS Selectors - Code Challenge: Basic Selectors

Hey,

I am busy trying to do the Basic Selectors code challenge (Part 1 of 5) where it asks to select the h1 and change the background color to blue.

Here is my attempt:

h1 { background-color: #ADD4DE; }

When I try submit I am told to check my h1 selector, but the preview pane shows the h1 selected and given a background color of blue.

Any ideas?

Dani

3 Answers

Dani Dayan
Dani Dayan
1,951 Points

@James - Thanks for your response. Turns out I hadn't read the required correctly. It asked me to select and change the color of the h1 itself, not the background. Rookie error I guess ^_^

James Barnett
James Barnett
39,199 Points

@Dani - Try using the color keyword blue. As the hex value you used is a shade of blue, but not the color blue itself.

did that, the refresh is fine but code challenge says "Bummer! Check the selector in your css." Am i missing something? Thanks!

/* Complete the challenge by writing CSS below */ h1 { color: blue; }

h1 em { color: red; }

I don't know what I'm doing wrong but I've tried everything you guys said and still nothing. What should I do?

James Barnett
James Barnett
39,199 Points

Hard to say without seeing your code. Create your own thread and post your code.

The code that im using is H1 em {color:blue; }

James Barnett
James Barnett
39,199 Points

What's that em element doing in there?

That was the last one that I tried I've gone through of code

    H1 {color:blue;} was another one

I found out what happened it was an unnecessary mistake. Thanks for the help though