Learn HTML Forms by Building a Registration Form - Step 18

Tell us what’s happening:

 <fieldset>
        <label for"firstname" id="first name">Enter Your First Name: 
          <input type="text">
        <label for"lastname"id="last name">Enter Your Last Name: 
          <input type="text">
        <label for"email" id="email">Enter Your Email: 
          <input type="email">
        <label for"newpassword" id="new password">Create a New Password:
          <input type="new password">
      </fieldset>

just don’t know what i am doing wrong

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 for"firstname" id="first name">Enter Your First Name: 
          <input type="text">
        <label for"lastname"id="last name">Enter Your Last Name: 
          <input type="text">
        <label for"email" id="email">Enter Your Email: 
          <input type="email">
        <label for"newpassword" id="new password">Create a New Password:
          <input type="new password">
      </fieldset>

<!-- User Editable Region -->

      <fieldset></fieldset>
      <fieldset></fieldset>
    </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/125.0.0.0 Safari/537.36

Challenge Information:

Learn HTML Forms by Building a Registration Form - Step 18

Welcome to the FCC forum. You have missing the = equal sign and dash - between your attributes values for the id and for attribute.

Hello and welcome to the forum.
The id attributes should be in your input elements, not in your label element.
In your label elements your for attribute needs an = that gives the value.
Also check the instructed values, and the values that you have. It has to be the exact same like how it is in the instruction. You are missing the -
I recommend you reset your code and try again.
Here is an example: <label for="blue-curtain">Blue Curtain <input type="_" id="blue-curtain">

When you write a value that has more then one word, the words should be separated by a - dash and the attribute should always have = equal sign before it’s value.

i get where the dash is supposed to go but = sign did i miss?

what = sign did i miss?

You didn’t get it check your code carefully. And you need to move id attribute and it’s value within it’s appropriate input elements.

Example for adding attribute and it’s value within an element:

<elementName attribute="value" attribute="double-value">

so, do i need to put an = sign after the for? i am really confused.

Yes of course. When ever you want to add attribute that need a value, what ever attribute you adding that need a value. You need to add always equal sign after that before it’s value.

in HTML, we have tags like <input and <img which don’t have equal signs and we have attributes which almost always need an equal sign and a value such as for href="something" or id="" and for the attribute called for as well.

Read this article about attribute:

@redneckcornerts

so i need an = after the for right?
where does the id attribute go?

1 Like

for the challenge step your id attribute and it’s value will be goes within the input elements. It would be better to reset your code and try from start to add the for and id attribute with it’s value to exact label and input elements.

Tell us what’s happening:

Enter Your First Name: Enter Your Last Name: Enter Your Email: Create a New Password:

it tells me that the first input should have an id of first name?

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 for="first name">Enter Your First Name:<input id="first name"> 
        <label for="last name">Enter Your Last Name:<input id="last name">
        <label for="email">Enter Your Email:<input id="email">
        <label for="new password">Create a New Password:<input id="new password">
      </fieldset>

<!-- User Editable Region -->

      <fieldset></fieldset>
      <fieldset></fieldset>
    </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/125.0.0.0 Safari/537.36

Challenge Information:

Learn HTML Forms by Building a Registration Form - Step 18

In general, the attribute called id can be added to any opening tag for any html element.
You should check the step’s instructions to see what they want you to do (the location asked by different steps will depend on the step). But in general, all attributes must be placed in the appropriate opening tag.

not quite! It says first-name
notice there is a dash in the middle!

I will be closing this duplicate version of your question which you started in a different post. Please do not open duplicate posts in future for the same issue. (all duplicates are now merged into one forum topic)

i got it
i really appreciate the help
thank you

1 Like

Good luck, keep it up. Happy coding