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
Kamil Razak
18,596 PointsCode Challenge: CSS Foundations Selectors Type, Class, and ID Selectors
Does anyone know what I did wrong here?
The question is Select the em inside the paragraph using a descendant selector. Set its color to 'red'. My code is as below:
body{ background-color: lightblue; }
h1 { color: darkblue; }
h1 em{ color: red; }
Thanks in advance!
Brendon Attebury
3,866 Pointsoops sorry looks like this:
p em{ color:red; }
Kamil Razak
18,596 Pointshi Brandon,
I don't know what went wrong with your case. I think you are already correct with the code and the text is supposed to be red.
1 Answer
Kevin Korte
28,149 PointsYes, you didn't use the descendant selector, which is " > ".
You also selected an h1 instead of a paragraph.
Kamil Razak
18,596 PointsHi Kevin,
Thanks Kevin. The error is because I've used h1 instead of paragraph. Thanks for pointing that out.
Brendon Attebury
3,866 PointsBrendon Attebury
3,866 PointsOkay, I am having the same issue except when I type the color as red the text actually turns red. Here is what I have written:
p em{ color:red; {