Create a Set of Radio Buttons ... what's the problem in my code

Create a Set of Radio Buttons ... what's the problem in my code
0

#1

Mycode 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">
    <input type="text" placeholder="cat photo URL" required>
    <button type="submit">Submit</button>
    <label>
      <input type="radio" name="indoor-outdoor">Indoor
      <input type="radio" name="indoor-outdoor">Outdoor
    </label>
  </form>
</main>

Your browser information:

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

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


when I’m running the code it says :

Each of your two radio button elements should be nested in its own label element.

so, what’s the problem ??
I couldn’t understand where’s the wrong.


#3

isn’t it self-closing ??
can you write for me the right way? :pray:t2: :pray:t2:


#5

You put your two inputs inside one label, they must be inside on their on label, one label for each input:
<label><input></label>


#6
type or paste code here
```<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><br>
    <input type="text" placeholder="cat photo URL" required>
    <button type="submit">Submit</button>
  </form>
</main>

#7

ahaaaa … so that’s my wrong !!
thank you so much !! :heart_eyes:


#8

everyone of theme must be on his ouwn label


#9

thank you sooooo much :heart_eyes::heart_eyes::relaxed::relaxed: :hibiscus: :hibiscus:


#10

yes thank you :hibiscus: :hibiscus: ~(@^-^@)~


#11

pleasemark my response us apt


#12

you are welcome :wink: :grinning:


#13

please mark my response as a solution