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

HTML Introduction to HTML and CSS (2016) Make It Beautiful With CSS Test: Styling by Element and Class

Can anyone tell me what I'm doing wrong?

I keep writing this rule and the error message still shows

index.html
<!doctype html>
<html>
  <head>

   <p class="main-pg">My amazing website</p> 
    <link href="styles.css" rel="stylesheet">
  </head>
  <body>

    <p>My amazing website</p>

</body>

</html>
class=".main-pg"
styles.css

2 Answers

Hey Lynn, I commented on your last question, but your class declaration belongs within you <p> tag. You also dont need a "." in the class when declaring it, only when referencing it in CSS/JavaScript. Here is what challenge step 1 should look like:

<!doctype html>
<html>
  <head>
    <link href="styles.css" rel="stylesheet">
  </head>
  <body>

    <p class="main-pg">My amazing website</p>

  </body>
</html>

Step 2:

.main-pg {

}

And finally the paragraph styles in step 3:

.main-pg {
    border: 4px solid red;
}

Good luck, and keept at it!

Dylan

But where does it go??????????

Where in the document does it go???? Before the body tag?

This should be the only thing inside your index.html.

<!doctype html>
<html>
  <head>
    <link href="styles.css" rel="stylesheet">
  </head>
  <body>

    <p class="main-pg">My amazing website</p>

  </body>
</html>

<p class="main-pg">My amazing website</p>

that is where the class is being referenced

These both go inside styles.css for their respective steps. Nothing else should be in there

Step 2:

.main-pg {

}

And finally the paragraph styles in step 3:

.main-pg {
    border: 4px solid red;
}