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 trialAndras Matyo
363 PointsAdd a class called "main-pg" to the paragraph element.
the body and the html sign at the end is getting red . the program is still telling me bummer
<!doctype html>
<html>
<head>
<link href="styles.css" rel="stylesheet">
</head>
<body>
<p>My amazing website</p>
<p> <h2 class="main-pg" >
</body>
</html>
9 Answers
victor cooper
6,436 PointsHello there!
<p>My amazing website</p>
<p> <h2 class="main-pg" >
The first paragraph <p> ... </p> is good, what comes after you can remove, <p> <h2 class="main-pg" > is not necessary here, after you remove them to the first paragraph add a class main-pg. like this
<p class="main-pg"> ...</p>
Hope this helps
Andras Matyo
363 PointsAdd a class called "main-pg" to the paragraph element.
Tadeáš Firich
7,866 PointsHello Andras Matyo, the text of the challenge is "Add a class called "main-pg" to the paragraph element". Go to the challenge and focus on line 8.
<p>My amazing website</p>
This line represents text: My amazing website, and it is bounded by two p elements. If you want to add the class you just type class behind the p tag. Like this:
<p class="">My amazing website</p>
Others are already up to you. Was it helpful for you?
Andras Matyo
363 PointsYou need to set the 'class' attribute of the <p> element to "main-pg
victor cooper
6,436 PointsCould you show your current code? we could see whats wrong and help
Andras Matyo
363 Points<link href="styles.css" rel="stylesheet"> </head> <body>
<p>My amazing website</p>
<p> <h2 class="main-pg> </p>
</body> </html>
victor cooper
6,436 Points<!doctype html>
<html>
<head>
<link href="styles.css" rel="stylesheet">
</head>
<body>
<p class="main-pg">My amazing website</p>
</body>
</html>
Andras Matyo
363 Points<link href="styles.css" rel="stylesheet"> </head> <body>
<p>My amazing website</p>
<p> <h2 class="main-pg> </p>
</body> </html>
Andras Matyo
363 Pointsit has worked! thank you again!
Andras Matyo
363 PointsAndras Matyo
363 PointsThank you!
Andras Matyo
363 PointsAndras Matyo
363 Pointsit doesn't show anything red on html but still doesn't accept it .should I do something In css?
Tadeáš Firich
7,866 PointsTadeáš Firich
7,866 PointsPlease paste your code then we can help you. :)