Learn HTML by Building a Cat Photo App - Step 56

Hi,

I’m trying really hard to nest text within an element. I think I have the element right. I think I have the for=“Loving” right. For some reason I can’t seem to get the text to be text because it is always highlighted blue. I’ve tried all combinations of capitols and spaces I can think of.

It’s been three days. I’ve checked MDM and W3Schools. I’ve gone back to the YouTube Learn HTML – Full Tutorial for Beginners (2022) tutorial (Learn HTML – Full Tutorial for Beginners (2022) - YouTube). I’ve redone the course three times, going back to the beginning when I get stuck at Challenge 56.

Honestly, I can’t even explain how I’ve made it this far. All I know is it keeps getting easier to figure out. Except for 56. WTH am I doing wrong?

Thanks in advance!
Your code so far

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

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 label opening tag is missing the > after the word “loving”.
Also you have too many spaces around the word Loving. There should be none.

You should make sure that there is a single space between the input and the label though.

Thank you for the backtick and forward slash tip. I think that is HTML… like, this is important and this is emphasized using ** and *.

The changes worked!

I have another question… what is the difference between the “input” and “label” elements? Why does one require “>” and the “</>” formatting/syntax to close? Why one and not the other?

Have a fantastic day.

I think I can answer my own question. Input is a self closing tag and that is something a person just needs to remember.

yes true. But you don’t need to write <input /> as <input> is also valid