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
Birk Dinges
10,551 PointsStuck 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
Elliott Frazier
Courses Plus Student 9,647 Pointsinstead of the color value "background-color: #0ff;" have you tried using "background-color: lightblue;"?
Birk Dinges
10,551 PointsWhoops. 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. ;-)
Elliott Frazier
Courses Plus Student 9,647 PointsNo problem!
- Happy Coding!
Carlos Gomez
5,274 PointsHad the same problem. The error message did not match the actual problem for sure, so it was confusing for a bit.
James Barnett
39,199 PointsThere 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.
Carlos Gomez
5,274 PointsWill do. Thanks for the tip!
James Barnett
39,199 PointsJames Barnett
39,199 PointsThe reason for this is that the CSS color keywords actually correspond to a particular hex color. For instance the color keyword
lightblueis equivalent to#ADD8E6.Here's the complete list of CSS color keywords and their hex color equivalents.