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 trialLynn Collins
10,080 PointsWhere in a paragraph tag can I set the class attribute class="main.pg"?
I am having a hard time figuring out how to where in a paragraph tag to put class="main.pg".
2 Answers
Jamie Reardon
Treehouse Project Reviewer<p class="main-pg">Your paragraph content here...</p>
Replace the above "Your paragraph content here" with your own paragraph content.
Any attributes you want to add such as classes to elements, go inside the opening tag like above.
They are defined by their attribute name (in this case class) followed by an equal sign (=) and a set of quotes, single or double ("") and inside the quotes, is the value for the attribute.
More examples:
<a class="classname">Link</a>
<p class="intro">Paragraph content...</p>
<a href="linktofacebook">Facebook</a>
nick67
Front End Web Development Techdegree Graduate 18,812 PointsJust put it right after the first p tag <p class="main.pg">Text</p>