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

Css challenge 6: Select the class intro and set its font weight to bold.

I'm stuck on this problem. Plz help asap. Other people have tried this and have not find a solution. Please give me a answer for this challenge. Here's the link to the challenge: http://teamtreehouse.com/library/websites/css-foundations-2/selectors-reshoot/type-class-and-id-selectors

10 Answers

Nabil Kamel
Nabil Kamel
7,170 Points

and the css:

/* Complete the challenge by writing CSS below */
body {
  background: lightblue;
}
h1 {
  color: darkblue;
}
p em {
  color: red;
}
.intro {
  font-weight: bold;
}
Nabil Kamel
Nabil Kamel
7,170 Points

.intro { font-weight: bold; }

that doesnt work i did this and it says there's a error

Nabil Kamel
Nabil Kamel
7,170 Points

have you correctly added the intro class on the p element of your HTML ?

<p class="intro">

yes

Nabil Kamel
Nabil Kamel
7,170 Points

then you should start over. refresh your browser, sure something went wrong

can u just show me how the html should look like. idk how to show u what i did

idk how to post the picture

i did p class="intro" with the curly braces. Btw i tried resfrehsing thw broswer it doesnt work

Nabil Kamel
Nabil Kamel
7,170 Points

if you succeeded the 5 first steps, then your HTML should be correct.

Nabil Kamel
Nabil Kamel
7,170 Points

what's the error message you get ?

Nabil Kamel
Nabil Kamel
7,170 Points

this is how your HTML should look like:

<!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><em>Hello</em> World!</h1>
    <div id="main">
        <p class="intro">
            <em>Lorem ipsum dolor</em> 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>

thats exaclty what i did

Nabil Kamel
Nabil Kamel
7,170 Points

sorry the id="main" should go on the div and not body

thank you

yes it did and btw how to post the picture of the html and css?

Nabil Kamel
Nabil Kamel
7,170 Points

wrap your code between three backticks on each side of your code: `

ok

Nabil Kamel
Nabil Kamel
7,170 Points

check the Markdown Cheatsheet just above the text area