Post

I somehow only just realised that if you hover a label it matches `:hover` on the associated form control... Is this common knowledge? I feel like it's probably one of those things that I actually already did know and have just forgotten.

1 repost14 likes

Wait, this is so interesting thanks to <button> being a form control. Some behavior only possible with :has(:has()) may be possible using this... wow! <object> & <fieldset> don't seem to work with this even though it is a "labelable" form control according to MDN

Huh, never realized that since I tend to nest controls inside their <label>. Very, very interesting. I wonder how you can abuse this since <button> is a form control😮

I literally learn new things about HTML daily and have been honing my skills with it over 25 years. Thank you for this insight!

Interestingly it doesn't forward mouse events like mouseover (other than click "obviously"). But it does apply `:active` and `:hover` (interestingly it doesn't do this for :focus)

`:active` and `:hover` work this way, :focus doesn't seem to, but then setting tabindex on your label is pretty weird.