3 ms·
For what it's worth, I've found that I almost always want to put the label tag after the input tag. That enables me to select and style the label based on the i
by parasti 3y ago
For what it's worth, I've found that I almost always want to put the label tag after the input tag. That enables me to select and style the label based on the input state via CSS pseudoclasses.
- marcosdumay 3y agoOne more hack created by the lack of the :has selector. And yet browsers won't prioritize it.
- clairity 3y agosafari and chrome have had :has() for a while, but it's behind a flag in firefox. the firefox version is good enough that i wish they'd unflag it already (as in, it's good enough to handle this particular input/label issue for instance, but not really complex selector combinations and edge cases).