Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS

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
seal-mask
.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>