Error "Radio button elements should be nested in its own label element"

Tell us what’s happening:

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 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36.

Challenge: Create a Set of Radio Buttons

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

I keep having this error:
Each of your two radio button elements should be nested in its own label element.

For this assignment, you need to nest each input radio button within its respective label.

I thought I did that already. Can you please show where I didn’t do correctly?

Right now, your inputs are on top of the labels. They need to be inside the labels.

1 Like

look at the example code in challenge description, note that the input element is between the tags of the label element

thanks alot…now i understand, it’s fixed.

thanks alot to you too…now i understand, it’s fixed.

its not yet helping I have tried its still saying the same as below
Each of your two radio button elements should be nested in its own label element.

can you please show us the way we put inside the label I have really confused Please help

Hi hajjiyare33,

Please check the example code given in the challenge description, you’ll get it.
Just follow the same process.

Yo, this worked for me: