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

We want the same CSS style to apply to both <div> elements. Give both <div> elements the class of "favorite_stuff".HUH?

We want the same CSS style to apply to both <div> elements. Give both <div> elements the class of "favorite_stuff". Hint: The syntax for giving a <div> a class looks like this: <div class="favorite_stuff"> Bummer! Your <div> elements need to both have 'class' attributes.

I have no Idea what to do here.

index.html
<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>

3 Answers

Matthew Long
Matthew Long
28,407 Points

Looks like it basically gives you the answer in the hint. It wants you to add class="favorite_stuff to both div elements:

<div class="favorite_stuff">
  // other elements are here
</div>

The next challenge is very similar. You will be adding type="text" to the inputs. Let me know if you need more help with this!

Edwin Buitrago
Edwin Buitrago
2,726 Points

You can use the same class name many times as long as you want to apply the same styles to an element. In this case adding the class= "favorite_stuff" to both divs will apply the same CSS styles. It's great for you not having to repeat your code many times if you want to apply same styles.

ok thanks