Step 46 from HTML Course Possible Bug

Hello! I think I did what the exercise asked, but I receive the message “Sorry, your code does not pass”.
My code is:

<label><input id = "outdoor" type = "radio">Outdoor</label>

So, it is a radio type input inside a new label, it has the id “outdoor” and the option “Outdoor”. Do I miss something or is it a bug at this step?
P.S. I clicked on the radio buttons and they remain selected, like check boxes. If they are radio type, only the current clicked button should remain selected.

Your code does not have the required spacing. I think the hint should explain where the missing space should be.

1 Like

Thanks. I should have read the hint :man_facepalming:
I did not know that spacing matters in HTML.
Normally:

<label>                Outdoor</label>

should be equivalent to:

<label>Outdoor</label>

?

The spacing is between the label text and the radio button. The challenge wants the two not so smooshed together.

1 Like

Is it a best practice to have a space between the elements?

<p id="p1" class="c">Paragraph_1</p>

vs

<p id = "p1" class = "c" > Paragraph_2 </p>

Best practice is your first example with no spaces around the =

For Paragraph_2, the spaces will show up and possibly mess with your alignment settings (like align center or left) that you may use later. Best to not use unless you specifically need a space for some reason

2 Likes

In this case, it is more ‘normal’ to see

Outdoor

than

Outdoor

So that’s why the space is needed.

Thank you for the answer.

I tried this and it made no difference.
I guess the spaces are important using with more advanced notions. I’ll follow your advice.

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