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

Antonette van der Wal
Antonette van der Wal
8,926 Points

Set <div> for second div element

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: The class attribute on your second <div> element needs to be set to "favorite_stuff". Make sure it's all lower case, and that you have an underscore character in the middle.

Where and how to put the second <div> element?

index.html
<body>
  <h1>First Day of School</h1>

  <form>
  <div class="favorite_stuff">
    <div>
      <h4>Favorite Foods?</h4>
      <input name="food[]">
      <input name="food[]">
      <input name="food[]">
      <input name="food[]">
    </div>
  <div class="favorite_stuff">    
    <div>
      <h4>Favorite Animals?</h4>
      <input name="animal[]">
      <input name="animal[]">
      <input name="animal[]">
      <input name="animal[]">
    </div>

  </form>

</body>

1 Answer

Liam Clarke
MOD
Liam Clarke
Treehouse Moderator 18,894 Points

Hi Antonette

You almost got it, the challenge is asking you to give a class to the already existing div, not create another one

<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>

Good Luck!