Learn HTML Forms by Building a Registration Form - Step 17

**Need help on how to nest <input> on <label> **

So i try to nest <input> on <label> and i tried several solutions but they won’t work.

Directions:

Nest an input element within each label. Be sure to add each input after the label text, and include a space after the colon.

!/ i tried space and it doesn’t work. On my code i used enter between the label.

Your code so far

<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Registration Form</title>
    <link rel="stylesheet" href="styles.css" />
  </head>
  <body>
    <h1>Registration Form</h1>
    <p>Please fill out this form with the required information</p>
    <form method="post" action='https://register-demo.freecodecamp.org'>

<!-- User Editable Region -->

      <fieldset>
        <label>Enter Your First Name:</label>
          <input> 
          </input>
        <label>Enter Your Last Name:</label>
          <input> 
          </input>
        <label>Enter Your Email:</label>
          <input> 
          </input>
        <label>Create a New Password:</label>
          <input> 
          </input>
      </fieldset>

<!-- User Editable Region -->

      <fieldset></fieldset>
      <fieldset></fieldset>
    </form>
  </body>
</html>

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


**Your browser information:**

User Agent is: <code>Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.5 Safari/605.1.15</code>

**Challenge:** Learn HTML Forms by Building a Registration Form - Step 17

**Link to the challenge:**
https://www.freecodecamp.org/learn/2022/responsive-web-design/learn-html-forms-by-building-a-registration-form/step-17

To nest something means to put it inside of something. You put the inputs after the labels instead of nesting them.

Also, input elements don’t have closing tags.

1 Like

I’m trying this solution too but it tells me I’m still wrong. Where did I go wrong?

        <label>Enter Your First Name:<input/> </label>
        <label>Enter Your Last Name:<input/> </label>
        <label>Enter Your Email:<input/> </label>
        <label>Create a New Password:<input/> </label>
      </fieldset>

What is the hint telling you?

Test

Sorry, your code does not pass. Keep trying.

Hint

You should add the first input after the label text Enter Your First Name:, and include a space after the colon.

So which part of that hint are you not doing?

I reentered my solution identical from my previous post, and finally it works! Thanks!

        <label>Enter Your First Name: <input/> </label>
        <label>Enter Your Last Name: <input/> </label>
        <label>Enter Your Email: <input/> </label>
        <label>Create a New Password: <input/> </label>
      </fieldset>

I think i missed my spacing after the text :confused:

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