Nesting Couldnt figure it out

Tell us what’s happening:
Not sure what they mean by nesting

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

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 (X11; CrOS x86_64 12871.102.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.141 Safari/537.36.

Challenge: Create a Set of Radio Buttons

Link to the challenge:

Hello there,

Have a look at the example, it is very close to what the challenge expects of you. So, you can almost copy-pasta.

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

Some extra info: You can only nest an element (called the child) in another element (called the parent), if the parent is the type of HTML element which has a closing tag. That is to say:

<input type="radio">
/* No Closing tag for this element. So, it cannot be a parent */
<label><h1>Hello World</h1></label>
/* Label can be a parent, because it has a closing tag */

Hope this helps

1 Like

Thanks! Appreciate it!