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 trialYitong Zhang
1,190 PointsStuck on "Select the class 'intro' and set its font weight to bold."
Is anything wrong with the code? It doesn't work and I can't figure out why.
body {
background-color: lightblue;
}
h1 {
color: darkblue;
}
p em {
color: red;
}
.intro {
font-weight: bold;
}
Mike Bronner
16,395 PointsHere's the link to the challenge: http://teamtreehouse.com/library/websites/css-foundations-2/selectors-reshoot/type-class-and-id-selectors
2 Answers
Mike Bronner
16,395 PointsThere are two reasons it could be failing:
[incorrect advice removed - see James' explanation setting me straight. :)]
- there may be an issue with the HTML file. Perhaps your class declaration is incorrect?
I just went through the challenge and solved it successfully using the same .intro class declaration like you have listed above.
James Barnett
39,199 Points>
your "p em" selector is not what the previous step asked for -- they specifically said "using a descendant selector"
I think you got confused here between the descendant
selector and the child
selector. A space is the correct combinator for a descendant selector whereas a child selector uses a >
.
for reference: http://learn.shayhowe.com/advanced-html-css/complex-selectors
Mike Bronner
16,395 PointsYes, you're right. Interestingly enough, the child-selector passed the test -- probably because it fulfilled the same criteria for this test. :)
James Barnett
39,199 PointsYitong Zhang - Your CSS is right, however you didn't post your HTML. This challenge is 6 steps, 4 of them are CSS and 2 are HTML. My guess is that your issue is related to how you added the class name.
James Barnett
39,199 PointsJames Barnett
39,199 PointsWithout a link to the code challenge you are having issues with, someone would have guess which one it is, to be able to test out their solution.