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 CSS Foundations Selectors Type, Class, and ID Selectors

People have answered this but it is still not passing the challenge... Select the class intro and set its font weight to

Select the class intro and set its font weight to bold. -And I actually have it right according to answers here on the forum.

6 Answers

Did that help you, Lee Ann?

"A" for effort...

Ensure that the element you are selecting has its class attribute set to intro and then simply add the following to: 1) the in-line style attribute, 2) an internal stylesheet or 3) an external stylesheet that is properly linked to the html file:

.intro { font-weight: bold; }

Notice the "." before intro, which is very important to tell the browser that you are selecting a class named "intro". I hope that helps.

This is my css, but oddly it is not passing...

.intro {
  font-weight: bold;
}

and html:

    <p class="intro">

I'm not sure if this is a typo made on your HTML page or just on this site, but it seems as though your "p" element is not enclosed properly. You have a ) on a side that should be a >. Here's a very simple html page that illustrates how to make the font weight bold. Check your page against this page.

<!DOCTYPE html>
<html>

<head>
<style type="text/css">
.intro {
font-weight: bold;
}
</style>
</head>

<body>
<p class="intro">This is my sample class that will be bold.</p>
</body>
</html>

Marcus, Thanks.

Some people have commented that they (seemingly) refreshed and then passed the challenge. IDK if this is completely accurate, but I seem to have the coding correct but it is not passing.

Is this incorrect?

I have actually ran into some problems with the challenges, as well. Make absolutely sure you are putting the code where they want you to put it. I believe they are using some sort of absolute reference to where the code you type is in relation to where the existing code is, and I think what happens is that, like myself, you might tend to put code where you know it should work but not absolutely where they said it should go. Be absolutely sure there are no typos present within the HTML nor the CSS file. Then, be sure that the code is in the spot they require it to be in. It's a nice system, but it can be a tad wonky at times lol.

Jason, surely you must know that the "p.intro" is almost exactly the same as ".intro". It is not going to change the fact that she cannot see the CSS being applied. To be clear, "p.intro" only differs from selecting ".intro" in that "p.intro" selects only those elements with the class attribute of "intro" within p elements. In other words, you are trying to apply a more specific selector which is not helpful to the problem at hand.