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

marsha spell
PLUS
marsha spell
Courses Plus Student 5,555 Points

help please

Challenge task 3 of 6

Select the em inside the paragraph using a descendant selector. Set its color to 'red'. here is what I got.... em {color: red; } not sure what I'm doing wrong here

5 Answers

What you're saying is "select all em tags in the HTML document, and apply a font color of red"; opposed to saying "select all em elements that are nested within a paragraph element and add the properties to it". To do this you need to provide two selectors: The first being, I guess, "the parent" element", and the second being the nested element you want too retrieve from that parent element. They should be separated using a space.

You need to select the <em> tag that is specifically inside a <p> tag, I guess that there is probably only one in the example, but if there were more your code would select every <em> tag on the page. Try to be more specific (you need to have the <p> tag referenced somewhere)

Oh, it didn't display the html tags... You need to select the 'em' tag that is specifically inside a 'p' tag, I guess that there is probably only one in the example, but if there were more your code would select every 'em' tag on the page. Try to be more specific (you need to have the 'p' tag referenced somewhere)

Maya Han
Maya Han
6,069 Points

I'm guessing that 'em inside the paragraph' would be: p em {color:red;}