Label element: child or for attribute?

Regarding the Basic HTML and HTML5: Create a Set of Radio Buttons challenge:

Is it just as valid to not nest the input element inside the label element if the label’s for attribute value is equal to the input’s id value?

The instructions say that doing so will explicitly link the two elements. However, the tests failed when I tried it.

the challenge explicitly asks you to nest the inputs in the labels

Thank you, that’s what I ultimately did in order to pass the challenge. I was wondering about the difference, if there is one, between connecting a label and input through their attributes or a parent-child relationship.

there are tons of discussions, arguments, on this topic, but what matters is that they are linked in some way, which way is better is under heated discussion even now in some places of the web

one important thing is that if they are nested you can’t style them separately with css, if they aren’t nested you can style them indipendently

Thanks for following up :smiley: