HTML and CSS Assessment Input/Label Help

HTML and CSS Assessment Input/Label Help

Hello everyone! I got kicked back as missing 2 questions on the HTML assessment but cannot figure out what I am doing wrong. I think I’m close, but am just missing some small detail.

The explanation for what I got wrong is as follows:

  1. " has exactly one input with a name of ‘pet_name’ and an associated label with the content ‘Name’"
    and 2) “has exactly one ‘select’ element with a name of ‘pet_type’ and an associated label with the content ‘Type’”

I’ve looked over my code over and over and don’t see the issue. Any help would be much appreciated!

Below is a screenshot with the relevant portions highlighted.

Thank you!!
–Brandon Bartlett

Hey! Im super new at this, so double check with someone else, But i pretty sure i read that your “for” and “id” values need to match. So instead of putting “pet_name” try just putting “name”

3 Likes

for your “for” value.
for=“name”

2 Likes

That looks like that is it. Here is a quote from MDN " To associate the <label> with an <input> element, you need to give the <input> an id attribute. The <label> then needs a for attribute whose value is the same as the input’s id ."

I’ll mark as a solution once I get the result back.

Thank you so much for your help!

–Brandon

1 Like

Sure no problem!

-Mathias