Learn HTML by Building a Cat Photo App - Step 56

Tell us what’s happening: Cant get the code to pass


Loving.

Your code so far: The text Loving should be wrapped in a label element.

<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>
            <legend>What's your cat's personality?</legend>

<!-- User Editable Region -->

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

<!-- User Editable Region -->

          </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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36

Challenge Information:

Learn HTML by Building a Cat Photo App - Step 56

Hi. You created the <label> tags which is good, now you just have to move them so that they enclose the “Loving” text.

3 Likes

Hi there, there is a small mistake in your code. You should wrap the text “Loving” in a label tag like you would with the h1, h2 and p tags. For example, if it said wrap the text “Hello” in a paragraph tag it would look like this:
<p>Hello</p>

PS: I’m providing examples so as to help without revealing the answer, hope you get it!

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

Notice how the text “Loving” is floating outside ? It should be nested between the label tags. “for” is an attribute used to bind a label to an input field(using the id or name), that is not the same.

I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

The text Loving should be wrapped in a label element. This is what its returns

You see how your current code does not wrap the word “Loving”? Thats what you need to do. Your label needs to go around the word and only the word “Loving” that comes after the input. The label should not be before the word

1 Like
  <input id="loving" type="checkbox"> Loving```

Check my previous response and see if you have any questions

<label for="loving"></label>

1 Like

Look at this comment here

Almost there, now make the Text “Loving” appear between your label tags

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