Learn HTML by Building a Cat Photo App - Step 56

Tell us what’s happening:

As everyone can see, the text IS wrapped in a label element. What is wrong?

“The text Loving should be wrapped in a label element.”

Your code so far

<html>
  <body>
    <main>
      <h1>CatPhotoApp</h1>
      <section>
        <h2>Cat Photos</h2>
        <!-- TODO: Add link to cat photos -->
        <p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
        <a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
      </section>
      <section>
        <h2>Cat Lists</h2>
        <h3>Things cats love:</h3>
        <ul>
          <li>cat nip</li>
          <li>laser pointers</li>
          <li>lasagna</li>
        </ul>
        <figure>
          <img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/lasagna.jpg" alt="A slice of lasagna on a plate.">
          <figcaption>Cats <em>love</em> lasagna.</figcaption>  
        </figure>
        <h3>Top 3 things cats hate:</h3>
        <ol>
          <li>flea treatment</li>
          <li>thunder</li>
          <li>other cats</li>
        </ol>
        <figure>
          <img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/cats.jpg" alt="Five cats looking around a field.">
          <figcaption>Cats <strong>hate</strong> other cats.</figcaption>  
        </figure>
      </section>
      <section>
        <h2>Cat Form</h2>
        <form action="https://freecatphotoapp.com/submit-cat-photo">
          <fieldset>
            <legend>Is your cat an indoor or outdoor cat?</legend>
            <label><input id="indoor" type="radio" name="indoor-outdoor" value="indoor"> Indoor</label>
            <label><input id="outdoor" type="radio" name="indoor-outdoor" value="outdoor"> Outdoor</label>
          </fieldset>
          <fieldset>

<!-- User Editable Region -->

            <legend>What's your cat's personality?</legend
            <label for="loving"> Loving </label>

<!-- User Editable Region -->

            <input id="loving" type="checkbox" value="loving">
          </fieldset>
          <input type="text" name="catphotourl" placeholder="cat photo URL" required>
          <button type="submit">Submit</button>
        </form>
      </section>
    </main>
  </body>
</html>

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36

Challenge Information:

Learn HTML by Building a Cat Photo App - Step 56

Welcome to our community!

You have deleted the part of the previous code.

Restart step.

P.S. The ‘label’ element goes after the ‘input’ element given by default in this challenge.

I don’t know how to restart the step. Please advise.

Click on the reset button:

Thank you, I did that and it still doesn’t work. Here is my current code and the error message:

        <label for="loving"> Loving </label>
        <input id="loving" type="checkbox"> Loving

“The text Loving should be wrapped in a label element.”

What is going on??

Example code:

<label for="breakfast"> Breakfast </label>
<input id="breakfast" type="radio" name="meal" value="breakfast">

Mine seems to match perfectly. I don’t understand.

Please help me. I don’t understand how the example code relates to my code. Where is the error? How does the label element fit inside the input element? I keep looking things up online and the code is so much more complex that it isn’t helping.

The ‘label’ element goes after the ‘input’ element given by default in this challenge. Wrap the word “Loving” in ‘label’ tags, as you already did…

<input><label>Word</label>

This is guidance.

Does the ‘label’ element go AFTER or WITHIN the ‘input’ element? Neither is working.

Please read the answer posted earlier.

<Thanks a lot, you were so helpful. i was stuck for like a day

1 Like