Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML HTML Forms Choosing Options Create Radio Buttons

iuliana sagaidak
iuliana sagaidak
4,797 Points

challenge question labels in HTML

Add a label above the radio button group that says "Shirt Size:". Don't associate it with any specific element.

<label>Shirt Size:</label>
<input type="radio" name="shirt_size" id="small" value="small">
<input type="radio" name="shirt_size" id="medium" value="medium">
<input type="radio" name="shirt_size" id="large" value="large">```

X Bummer! You need to use the text "Shirt Size:" 
within the new label element.
Antonio De Rose
Antonio De Rose
20,885 Points

Could you please try again with your code, it works fine for me, and I presume, you are at challenge 3 of 5.

2 Answers

iuliana sagaidak
iuliana sagaidak
4,797 Points

Tanks you a lot for help, but I understood my mistake:

        <label>Shirt Size:</label>
        <input type="radio" name="shirt_size" id="small" value="small">
        <label for="small">Shirt Size:</label>
        <input type="radio" name="shirt_size" id="medium" value="medium">
        <label for="medium">Shirt Size:</label>
        <input type="radio" name="shirt_size" id="large" value="large">
        <label for="large">Shirt Size:</label> ```


So I needed to put label after input, so I pass
Joshua Pyo
Joshua Pyo
2,931 Points

I'm not sure why we have to add label for each radio input like this to pass this step. That's not the instruction provided:

"Add a label above the radio button group that says "Shirt Size:". Don't associate it with any specific element."

        <label>Shirt Size:</label>
          <input type="radio" id="small" value="small" name="shirt_size">
        <label>Shirt Size:</label>
          <input type="radio" id="medium" value="medium" name="shirt_size">
        <label>Shirt Size:</label>
          <input type="radio" id="large" value="large" name="shirt_size">

Isn't the answer supposed to be this?

        <label>Shirt Size:</label>
          <input type="radio" id="small" value="small" name="shirt_size">
          <input type="radio" id="medium" value="medium" name="shirt_size">
          <input type="radio" id="large" value="large" name="shirt_size">