What is wrong with my radio

Tell us what’s happening:
hey so i followed the videos advice. or so i think. however im still being told that my radio elements should be nested in its own label element. i followed the video but i still dont know what im not getting.

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">
<input id="indoor" type="radio" name="indoor-outdoor">
<label for="indoor">Indoor</label>
<input id="outdoor" type="radio" name="indoor-outdoor">
<label for="outdoor">Outdoor</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.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36.

Challenge: Create a Set of Radio Buttons

Link to the challenge:

Your input function needs to be inside the label. Not outside. So you should have
(label)(input)(/label). That’s what it means by nested. Input will only be affected by the label if it’s inside the label function.

Each input element should come immediately after a label element.
E.g, Food

Hi stomkowkow,

You’re not essentially wrong. Actually, it’s right to put the label both before, after and around the input: https://stackoverflow.com/questions/774054/should-i-put-input-elements-inside-a-label-element
I don’t know which is the best practice though.

However, this specific task asks you to wrap the label tag around the input tag, as caddy showed . You can see the example in the text for the task:

<label for="indoor"> 
  <input id="indoor" type="radio" name="indoor-outdoor">Indoor 
</label>