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
Rubin Itermann
519 PointsI am Stuck
"Select the em inside the paragraph using a descendant selector. Set its color to red."
And thats where I'm right now.
/*
<!DOCTYPE html>
<html>
<head>
<title>CSS Selectors</title>
<link rel="stylesheet" href="cc1-main-styles.css" type="text/css" media="screen">
<link rel="stylesheet" href="style.css" type="text/css" media="screen">
</head>
<body>
<h1 id="h1"><em>Hello</em> World!</h1>
<div>
<p>
<h2><em>Lorem ipsum dolor</em></h2> sit amet, consectetur adipiscing elit. Nunc pulvinar consequat tortor, nec venenatis erat elementum scelerisque. Curabitur sit amet risus nisi. Aenean aliquet euismod augue at viverra. Ut varius arcu in lorem iaculis ullamcorper. Integer eu rutrum quam.
</p>
</div>
</body>
</html>
*/
style.css
#h1 {
color: #00f;
}
h2 em {
color: #f00;
}
Is there any error?
Cause it always says "Recheck work" and "Bummer! null" :(
4 Answers
Lea Marolt
5,127 PointsI just retried it, and it worked for me.
Lea Marolt
5,127 PointsWell you might want to use "red" instead of #f00? Even though the hex color is "pure red", they might be reading the challenge answers based on textual input, and not output.
Rubin Itermann
519 PointsI already tried it this way. The h2 still is red. So I guess thats not the problem. How do I "Select the em inside the paragraph..." ?
Isn't it enough to right
h2 em { color: #ff0000}
to select the em in the HTML?
Or do I have to do something in the HTML as well?
Rubin Itermann
519 Points...
Lea Marolt
5,127 PointsOh, wait, it says "the paragraph"? I guess you'd probably have to do "p em" as the selector, then.
Let me look at the challenge :P
Rubin Itermann
519 PointsI tried it this way too :P
It's the challenge in "Basic Selector"
Lea Marolt
5,127 PointsNo problem (: I'm glad it worked out.
Luca Terrigno
4,103 Pointsem { color: red; }
Rubin Itermann
519 PointsRubin Itermann
519 Points:D Really, I sat here mayby an hour and tried EVERY possible way. even this way too.
And now all of a sudden it works. Don't know what I went wrong.
Thank you for helping!!! ;)