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!

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


Where 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
.a{fill-rule:evenodd;}techdegree seal-36
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>