Stuck in step 30

I have nested the select element within an existing label element as guided but the code don’t pass. How should i fix this please?

   **Your code so far**
/* file: index.html */
<!DOCTYPE html>
<html>
 <head>
   <title>Registration Form</title>
	  <link rel="stylesheet" type="text/css" href="styles.css" />
 </head>
 <body>
   <h1>Registration Form</h1>
   <p>Please fill out this form with the required information</p>
   <form action='https://register-demo.freecodecamp.org'>
     <fieldset>
       <label>Enter Your First Name: <input type="text" required /></label>
       <label>Enter Your Last Name: <input type="text" required /></label>
       <label>Enter Your Email: <input type="email" required /></label>
       <label>Create a New Password: <input type="password" pattern="[a-z0-5]{8,}" required /></label>
     </fieldset>
     <fieldset>
       <label><input type="radio" name="account-type" /> Personal Account</label>
       <label><input type="radio" name="account-type" /> Business Account</label>
       <label>
         <input type="checkbox" required /> I accept the <a href="https://www.freecodecamp.org/news/terms-of-service/">terms and conditions</a>
			  </label>
     </fieldset>
     <fieldset>
       <label>Upload a profile picture: <input type="file" /></label>
       <label>Input your age (years): <input type="number" min="13" max="120" />
       <select>How did you hear about us?</select>
       </label>
      <select>
         <option></option>
         <option></option>
         <option></option>
         <option></option>
         <option></option>
       </select>
      </fieldset>
       
     <input type="submit" value="Submit" />
   </form>
 </body>
</html>
/* file: styles.css */
body {
 width: 100%;
 height: 100vh;
 margin: 0;
 background-color: #1b1b32;
	color: #f5f6f7;
}

label {
	display: block;
	margin: 0.5rem 0;
}

   **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.124 Safari/537.36 Edg/102.0.1245.41

Challenge: Step 30

Link to the challenge:

You were asked to nest the existing select within the label and give the label the text of How did you hear about us? before the select element.

Instead, you created a new select element and nested it in a label.

I would recommend to Restart the step and nest the existing select element within a new label element and give the text provided in the instructions before the select element.

I have nested the label element within the select element that i have. And that select element have an option element nested inside it. I don’t how to nest this label element. All i have tried doesn’t pass. :sweat: :sweat:

You have nested the label element within the select element? Its the other way round :arrows_counterclockwise:. You have to nest the select within the label.

Can you post your current code?

Here it is. I nested the select within the label

 <fieldset>
        <label>Upload a profile picture: <input type="file" /></label>
        <label>Input your age (years): <input type="number" min="13" max="120" />
         <select>How did you hear about us?</select>
			  </label>
        <select>
          <option></option>
          <option></option>
          <option></option>
          <option></option>
          <option></option>
        </select>
      </fieldset>

Can you see a select element which has some option elements inside it.
You have to nest the select element which has the option elements inside a new label element.

You can Restart the lesson and try nesting the select within a label and the text How did you hear about us? should be before the opening <select> tag but inside the label element.

Can I get some help here, I don’t get what I’m doing wrong.

  <fieldset>
    <label>Upload a profile picture: <input type="file" /></label>
    <label>Input your age (years): <input type="number" min="13" max="120" />
		  </label>
    <label>How did you hear about us?
    <select>
      <option></option>
      <option></option>
      <option></option>
      <option></option>
      <option></option>
    </select>
    </label>
  </fieldset>

This code is correct. Maybe you have an error in other place. You may want to reset the challenge and try again.

but I passed every step before this one. For some reason it’s just not letting me pass.

This line potentially…

    <label>Input your age (years): <input type="number" min="13" max="120" **/>**
		  </label>

is not a self-closing element, but you’ve attempted to close it in the first label. Delete that, should be good to go?

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.