I am trying to get my radio button to work as fancy buttons instead of just dots as they are by default, a question has crossed my mind. Many websites/snippet got it like
<input id="rad1" type="radio" name="rad"><label for="rad1">Radio 1</label>
<input id="rad2" type="radio" name="rad"><label for="rad2">Radio 2</label>
but the semantic mark up is more like
<label for="rad1"><input id="rad1" type="radio" name="rad">Radio 1</label>
<input id="rad2" type="radio" name="rad"><label for="rad2">Radio 2</label>
does the later markup is valid, as people are more able to control the layout
input[type="radio"]:checked+label{ font-weight: bold; }
but isn't the latter real valid?