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

Kudakwashe L Maluwa
Kudakwashe L Maluwa
9,271 Points

You need to create a rule for the main-pg class within the styles.css file.

In the CSS file create a rule for the .main-pg class. You don't need to write style instructions

index.html
<!doctype html>
<html>
  <head>
    <link href="styles.css" rel="stylesheet">
  </head>
  <body>
    <div class=".main-pg">
      <p class .main-pg="main-pg">My amazing website</p>
        .main-pg{
      }

  </body>
</html>
styles.css

2 Answers

David Kirton
PLUS
David Kirton
Courses Plus Student 12,981 Points

Heya,

The challenge wants you to put the code in a separate file. This is called external, so.. outside of the html.

You can also see your css linked in the head tag.

I didn't want to directly answer, just give a helping hand :)

All the best!

Justin Olson
Justin Olson
13,792 Points

Good day!

This is actually a lot simpler that it seems. The first step, you just want to add a class tag to the paragraph element:

  <body>

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

  </body>

On step two, you go to the CSS sheet, and add the requested class (nothing else is necessary at this point):

.main-pg {

}

And that will get you through to step three! Good luck!!