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

Stuck in CSS Foundations code challenge

Dear Treehouse Forum,

I seem to be stuck at the 2nd Selectors code challenge and don't really know what I'm doing wrong here. The 2nd task says "Use the Adjacent Sibling Combinator to select the <p> elements that immediately follow the h2. Set their background to lightblue.", which I did:

h2 + p { background-color: #0ff; }

Where is my mistake?

3 Answers

instead of the color value "background-color: #0ff;" have you tried using "background-color: lightblue;"?

The reason for this is that the CSS color keywords actually correspond to a particular hex color. For instance the color keyword lightblue is equivalent to #ADD8E6.

Here's the complete list of CSS color keywords and their hex color equivalents.

Whoops. Problem solved.. Thanks a lot! So apparently the error message doesn't necessarily match the actual mistake. I won't dare to ask such a simple question again. ;-)

No problem!

- Happy Coding!

Had the same problem. The error message did not match the actual problem for sure, so it was confusing for a bit.

There isn't such as thing as CSS errors, there is however CSS validation tools such as CSS Lint.

So my advice is to think of code challenge errors as generic errors and then validate your CSS.

If your CSS is valid, then double check the instructions.

Will do. Thanks for the tip!