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

I don't understand how to do this challenge.

I don't understand where to add the class main-pg

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

    <p>My amazing website</p>

  </body>
</html>
styles.css

Mike Mitchell
Mike Mitchell
Courses Plus Student 27,026 Points

Hey Henry, The challenge is asking you to add it to the paragraph tag. Think of a written page. Paragraphs make up the body of the content. In the example, it's not much of a paragraph. Just a sentence. Add that class right after the opening paragraph tag. Mike

1 Answer

Daniel Gauthier
Daniel Gauthier
15,000 Points

Hey Henry,

Classes are added to tags using the class attribute, so the first step of the challenge is asking for you to accomplish this by adding a class attribute to the paragraph element (it's also called a paragraph tag if that's what is causing confusion for you.

To complete this step, just turn this part:

<p>My amazing website</p>

into this:

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

Notice that we added the class attribute (left side of the equals sign) with a value of "main-pg" (right side of the equals sign) to the paragraph element. This way we'll be able to style the paragraph by targeting its class in the style.css in later steps.

Good luck with the course!

I really like your nice and simple answer, so you get an upvote from me. :) ~Alex