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

how do I add class "main-pg" to my work

can't seem to get this one right does anyone have example of what this look like I don,t see any hints or anything so I am stuck on this page

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

    <p>index-p="main-pg"</p>


  </body>
</html>
styles.css
.main-pg
SAMUEL LAWRENCE
SAMUEL LAWRENCE
Courses Plus Student 8,447 Points

Hi, if you want to add a class to an html element, you need to do it in the html file, and it has to be inside the first angle bracket after the name of the html tag. You put it in-between the tags. What goes between the opening and closing tags is the message you want to display to the page. you should do this.

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

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


  </body>
</html>

Thank you I will give this a try

1 Answer