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 trial

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,009 Points

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

Roni Lubwama
Roni Lubwama
3,456 Points

Thanks Jason. Truly appreciate.