Hi all,
I am learning the Responsive Web Design and following the courses.
I am stuck on Responsive Web Design Certification > CSS > Design a Registration Form > Step 31
I am getting this error:
“You should nest only the select element within a label element.”
I tried following but it’s not let me go further and keep getting errors.
<label for="referrer">
How did you hear about us?
<select id="referrer" name="referrer">
<option value="">(select one)</option>
<option value="1">freeCodeCamp News</option>
<option value="2">freeCodeCamp YouTube Channel</option>
<option value="3">freeCodeCamp Forum</option>
<option value="4">Other</option>
</select>
</label>
Any help me please to figure out what the issue here?
Thanks
Tejas
I am getting this error when i modify code like this:
<label for="referrer">How did you hear about us?
<select id="referrer" name="referrer">
<option value="">(select one)</option>
<option value="1">freeCodeCamp News</option>
<option value="2">freeCodeCamp YouTube Channel</option>
<option value="3">freeCodeCamp Forum</option>
<option value="4">Other</option>
</select>
</label>
“You should give the label element the text How did you hear about us?.”
dhess
July 4, 2026, 1:15pm
3
Welcome to the forum @tejas.hapani ,
Try putting the text on the same line as the opening label tag.
And were you asked to associate the label element and the select element or add a name attribute to the select element in this step?
You’re doing great, but to pass the tests, it’s important to do only what is asked in each step.
Happy coding
Hi @dhess
Thanks for your reply.
I tried putting text on same line as label tag and also tried it below label tag.
I also tried by removing name attribute on select element but it keeps saying same error.
I don’t get the error what exactly it is saying
Thanks
Step only asked you to nest the select element within a label element, but you have also changed your option element.
I would recommend you to reset this step by clicking the button shown in below image and then try again.
Happy coding~
dhess
July 6, 2026, 12:41pm
6
It looks like you may have changed the starting code in areas you were not asked to change, which will cause the tests to fail. Please click the reset button to restore the original code and try again, being careful to only make the changes asked.
Hi,
I just reset this step and retry and this time it works.
Thanks again!