Need help with each checkbox nested in its own label element

Need help with each checkbox nested in its own label element
0

#1

am kinda stuck somewhere here…its requesting me to nest my checkboxes in their individual label elements which I think I have already done but it still seems not to work,please help…tnx :

Your code so far


<h2>CatPhotoApp</h2>
<main>
  <p>Click here to view more <a href="#">cat photos</a>.</p>
  
  <a href="#"><img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."></a>
  
  <p>Things cats love:</p>
  <ul>
    <li>cat nip</li>
    <li>laser pointers</li>
    <li>lasagna</li>
  </ul>
  <p>Top 3 things cats hate:</p>
  <ol>
    <li>flea treatment</li>
    <li>thunder</li>
    <li>other cats</li>
  </ol>
  <form action="/submit-cat-photo">
    <label for="indoor"><input id="indoor" type="radio" name="indoor-outdoor"> Indoor
    </label>
    <label for="outdoor"><input id="outdoor" type="radio" name="indoor-outdoor"> Outdoor
    </label>
    <label for="personality"><br><input id="personality" type="checkbox" name="personality"> personality
    </label>
    <label for="personality"><input id="personality" type="checkbox" name="personality"> personality
    </label>
    <label for="personality"><br><input id="personality" type="checkbox" name="personality"> personality
    </label>

    <input type="text" placeholder="cat photo URL" required>
    <button type="submit">Submit</button>
  
  </form>
</main>

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/responsive-web-design/basic-html-and-html5/create-a-set-of-checkboxes/


#2

Hi,

Remove <br> before the input tags of type checkbox.


#3

You also might want to check your use of the attributes id and for


#4

thanks…i removed the
but it still isnt working…


#5

i dont really understand…can you please be more sppecific


#6

You have repeated id's for all the checkbox, id's should not be duplicated.

You should have separate id's for each checkbox and the for attribute should refer the id of checkbox

Edit: And if you have cleared the <br> tag and applied the above said suggestions, it will clear


#7

wow…it worked,thanks a lot man…u a life saver:grinning: