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 trialJenny Suh
200 Pointshelp with .main-pg set to paragraph class
<!doctype html>
<html>
<head>
<link href="styles.css" rel="stylesheet">
</head>
<body>
<p> <h1 class=".main-pg"</h1>
My amazing website</p>
</body>
</html>
<p> class=".main-pg"{
}
2 Answers
Steven Parker
231,248 PointsYou've got the class part right, but you have parts of another element there also (h1). The class setting should go right after the "p" inside the "<p>" tag <p class=".main-pg">
And nothing goes yet on the "styles.css" tab. When it does, the syntax will be different.
Jenny Suh
200 Pointsthanks!
Steven Parker
231,248 PointsJenny Suh — Glad to help. You can mark a question solved by choosing a "best answer".
And happy coding!
Gabriel Ruz
1,402 PointsGabriel Ruz
1,402 PointsWhen creating a class for an HTML element make sure to leave out the '.' when defining the class so for example:
You're asking to have the .main-pg set to paragraph class so it should be <p class="main-pg"> and not <p class=".main-pg">
And then when you're creating a declaration on the CSS style sheet to refer to the class you created you don't need to include the carrots.
To refer to a class element you simply just need to put the '.' to refer to any class created.
So it would be .main-pg