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

Where is my error?????

Can someone please tell me what I am doing wrong?

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>
.main-pg {

    }
</body>

</html>
styles.css

Lynn, check the answers on your last couple of questions, I posted the answers that will work for each step and where you went wrong. your error is the CSS should be in your styles.css and your .main-pg class declaration needs to be within the <p> tag.

1 Answer

Steven Parker
Steven Parker
230,274 Points

You won't start writing CSS until task 2. For task 1, you need to add the class to the paragraph element in the HTML. That will look something like this:

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

Then, when you do get to the CSS tasks, all the CSS code should go on the "styles.css" tab instead of mixing it in with the HTML.