Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML Introduction to HTML and CSS 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;
}