Confused? Stuck? Nested?? To the right?? HELP!!
<label><input id="loving" type="checkbox" for="loving"> Loving </label>
Confused? Stuck? Nested?? To the right?? HELP!!
<label><input id="loving" type="checkbox" for="loving"> Loving </label>
Hi @lucianamacchiarolo and welcome!!
How we can help you? This step is about to use the label
element and tell the browser engine this label has a relationship with that specific input
, they are more than close friends. An example:
<input id="ring" type="checkbox"> Put a ring on it
At this point the input
it looks as a checkbox and has the text "Put a ring on it"
at side. If you really want that everyone knows that the label for that specific input is "Put a ring on it"
, no just friends, then you are going to need to put a ring on it
<input id="ring" type="checkbox"> <label for="ring">Put a ring on it</label>
Did you see how I did that? The for
attribute in a label
element ===
id
attribute of input
element make them partners not just friends. Remember that spaces matters too (just another character like letters or symbols), just put the
label
tags around the text, and all together (<label for="ring">Put a ring on it</label>
) will become a label
element with a strong relationship with that specific input
.
I really hope this helps you Luciana, make you laugh and also think this way you won’t forget this syntax.
You can read more about this in MDN Web Docs and web.dev (probably easier to read). You can follow along web.dev courses as help in your freeCodeCamp
journey, pretty good stuff there.
It is normal feel bad sometimes, just do another thing, and back later to the problem but keep trying and asking for help. Baby steps every day it is not just a say it really helps, be consistent and don’t worry about others, you are improving in every step!!! Only focus in your ultimate goal not if the road has some stones, potholes or a river full of crocodiles, only in your goal, you will figure out how to solve those intermediate issues.
It would be wonderful if you could also post your code here
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 (').