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 trialLavan Kurumoorthy
Courses Plus Student 1,864 PointsHi, I am doing the MASH java course and have got to a code challenge where I have to name a <div> class. I can't get i
Hi, I am doing the MASH java course and have got to a code challenge where I have to name a <div> class. I can't get it as whenever I put in what I feel is correct i.e. <div class="favourite_stuff"> it doesn't work, any help will be appreciated. Thanks
<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
Emil Rais
26,873 PointsCould you show me what you have attempted? Basically you need to set a specific attribute on both div elements as explained in the challenge description.
Eric Eisberg
15,999 PointsClasses are assigned inside the tags. For this challenge, you're looking to set the div elements to the class "favorite_stuff". That will allow you to apply the same styling to both divs. I've included a demonstration, and hopefully you can apply it to your challenge.
<body>
<!-- I've given the following div the class "demonstration" -->
<div class="demonstration">
<p>The class identifier in the div tag above is a good example on how to assign a class.</p>
</div>
</body>
Georgia Heath
2,300 PointsHi there,
I am having this same problem. I am entering the syntax correctly as above, but it keeps sending a bummer message and telling me that the class attribute on both div elements needs to be set to <div class="favourite_stuff">. I've tried entering the information in the same way as the example in the workspace, but it isn't working. Am I doing something wrong, or is there possibly a bug here?
Marelize Venter
2,373 PointsHi Georgia and Lavan,
Having the same problem!! Any luck fixing it?
Emil Rais
26,873 PointsMarelize, what does your code look like? I'll help you get sorted out.
Marelize Venter
2,373 PointsHi Emil!
Thank you so much! really appreciate the offer. I actually found my mistake :) I had: <div> <div class="Favorite_Stuff">
Only one way to learn :)
Emil Rais
26,873 PointsGlad to hear it. Happy coding :)
Lavan Kurumoorthy
Courses Plus Student 1,864 PointsLavan Kurumoorthy
Courses Plus Student 1,864 PointsHi,
Thanks for getting back to me. I wrote div class="favorite_stuff" under both <div> tags.
It won't let me add the <> which I know come before the div and after stuff"