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 trialDavid Garcia
1,667 Pointshow do i give both <div> elements the class of "favorite_stuff"?
What am I missing?
<body>
<h1>First Day of School</h1>
<form>
<div>
<h4>Favorite Foods?</h4>
<input name="food[]">
<input name="food[]">
<input name="food[]">
<input name="food[]">
</div>
<div>
<h4>Favorite Animals?</h4>
<input name="animal[]">
<input name="animal[]">
<input name="animal[]">
<input name="animal[]">
</div>
</form>
</body>
4 Answers
Ethan Rivas
9,979 PointsHi David,
Just add the class attribute to the divs like this:
<div class="favorite_stuff">
Rafael Lima
9,421 PointsYou need to add a class to both of the DIVs:
<div class="favorite_stuff">
<h4>Favorite Foods?</h4>
<input name="food[]">
<input name="food[]">
<input name="food[]">
<input name="food[]">
</div>
<div class="favorite_stuff">
<h4>Favorite Animals?</h4>
<input name="animal[]">
<input name="animal[]">
<input name="animal[]">
<input name="animal[]">
</div>
jason chan
31,009 Points<body>
<h1>First Day of School</h1>
<form>
<div class="favorite_stuff">
<h4>Favorite Foods?</h4>
<input name="food[]">
<input name="food[]">
<input name="food[]">
<input name="food[]">
</div>
<div class="favorite_stuff">
<h4>Favorite Animals?</h4>
<input name="animal[]">
<input name="animal[]">
<input name="animal[]">
<input name="animal[]">
</div>
</form>
</body
you put class into the parent div. Make sure you know the hierarchy of html elements. This will come in handy once you start doing stuff on reactjs.
David Garcia
1,667 PointsThis is what mine looks like: <body> <h1>First Day of School</h1>
<form>
<div> class="favorite_stuff">
<h4>Favorite Foods?</h4>
<input name="food[]">
<input name="food[]">
<input name="food[]">
<input name="food[]">
</div>
<div> class="favorite_stuff">
<h4>Favorite Animals?</h4>
<input name="animal[]">
<input name="animal[]">
<input name="animal[]">
<input name="animal[]">
</div>
</form>
</body>
........AND IT STILL GIVING ME THE "BUMMER"!! HELP!
David Garcia
1,667 Pointsnever mind, i figured it out!!!!!
David Garcia
1,667 PointsDavid Garcia
1,667 PointsThat's what i keep doing but it's saying i have it wrong. What am i not doing correctly?
Ethan Rivas
9,979 PointsEthan Rivas
9,979 PointsDavid Garcia Try the answer provided by Jason Chan! It's the last answer of this thread.