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.

JavaScript Treehouse Club - MASH MASH - HTML Forms, Divs, and Inputs

Roni Lubwama
Roni Lubwama
3,456 Points

how do you give both <div> elements class attributes?

how do you give both <div> elements class attributes?

2 Answers

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

Roni;

You include the class name, in this case "favorite_stuff" in both <div> elements.

<div class="favorite_stuff">
   <!-- First div content -->
</div>

<div class="favorite_stuff">
    <!-- Second div content -->
</div>

Remember that you can use the same class values repeatedly on a page. id values must be unique on each page.

Post back with further questions.

Happy coding,
Ken

Roni Lubwama
Roni Lubwama
3,456 Points

Thanks Ken. Truly appreciate.

jason chan
jason chan
31,008 Points

So it can have the same style rule. You'll see soon.

Roni Lubwama
Roni Lubwama
3,456 Points

Thanks Jason. Truly appreciate.