I need help to put the indoor and outdoor link

Tell us what’s happening:
I can not put indoor and outdoor on my web..........`` Please help me`

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 nap</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>water</li>
</ol>
<form action="/submit-cat-photo">
  <input type="text" placeholder="cat photo URL" required>
  <button type="submit">Submit</button>
</form>
</main>

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




Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 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

Welcome to the forum @Alaya

There are a few issues with your current solution, and I highly suggest you’d reconsider the text of the challenge.

Add a pair of radio buttons to your form, each nested in its own label element. One should have the option of indoor and the other should have the option of outdoor . Both should share the name attribute of indoor-outdoor to create a radio group.

Here a few suggestions to guide you.

  • consider where your radio buttons are placed.

    <main>
       <form>
       </form>
    </main>
    
    <!-- your current radio buttons -->
    <input >
    

    Are you adding the radio buttons to the form?

  • compare your markup with the example for the radio button introduced with the challenge

    <label> 
      <input>
    </label>
    

    Which relation is there between the <label> and <input> elements?

    It might help you to break down the markup on multiple lines.

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

    In this manner you can see the structure of your elements, and where the code is actually breaking.

  • finally, which element is supposed to have a name attribute of indoor-outdoor?

    Currently, you add the attribute to a <label> element, but this value is shared among <input> elements to create a group of connected elements.

Let me know if this helps you in some way. And good luck.

1 Like