4 ms·
No JS - I was baffled - did not know about `<label for="<target here>">`. Nice. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label https://develop
by OJFord 8y ago
No JS - I was baffled - did not know about `<label for="<target here>">`. Nice.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label https://developer.mozilla.org/en-US/docs/Web/HTML/Element/la...
- stronglikedan 8y agoIMHO, the single-most underused HTML attribute. I get annoyed when I have to aim for the tiny box, instead of the nice long string of text next to it. Although, I can't count the number of times I was guilty of omitting it many moons ago.
- jancsika 8y agoIsn't it better to nest the checkbox inside the label? Then you don't need the for attribute nor an id.
- thristian 8y agoThat works nicely for checkboxes, but sometimes you want the form field and label to be in (say) different cells of a table row or something.
- jalbertbowden 8y agolabels should always be to the right of the checkbox/radio controls. never nest them. nesting is ok for other form controls in some instances, but you'll run into issues with various screen readers if you apply the for attribute while nesting. on that note, always nest when possible; the ux benefits make it crazy not to take advantage of it.
- forgotmypw 8y agoIs there a reason to not nest the checkbox inside the label? I have always put them next to the checkbox until very recently, when I was trying to increase clickable area. I've found it ends up working much better than putting it beside, covering the area around the checkbox, too! Is this "improper HTML"?
- forgotmypw 8y agoYou still have to do the complementary for= and id=, but I am also a proponent of nesting, though I have not solicited public opinion on it until just now. Here is how I started doing it: <label for=abc><input type=checkbox id=abc ...> display alphabet<label>
- stephenr 8y agoWhat do you mean by “have to”? The whole point of nesting is that the association is implicit.
- forgotmypw 8y agoI'm not sure how "proper" this is, but you can also put the checkbox inside the label, turning the whole thing into one big clickable area. <label style="padding:5pt"><input type=checkbox> this is label</label>
- rhn_mk1 8y agoIt seems to have a cost though, how do I link to a specific page? Anti-snark edit: what's the URL to a specific step?
- zepolen 8y ago<a href>
- deleted 8y ago[deleted]
- darkstar999 8y agoYou can't.
- Svip 8y agoCould have used `:target` instead then.
- Sir_Cmpwn 8y agoJust merged this patch which makes each page linkable :) https://lists.sr.ht/~sircmpwn/public-inbox/%3C20190404212127.23884-1-lukas%40lwrl.de%3E https://lists.sr.ht/~sircmpwn/public-inbox/%3C20190404212127...
- jalbertbowden 8y ago? https://git-send-email.io/#step-2 https://git-send-email.io/#step-2
- darkstar999 8y agoWell, it takes some form & css trickery as well. I'd call this more hacky than anything. It doesn't let you link to a specific step. https://git-send-email.io/index.css https://git-send-email.io/index.css
- gbear605 8y agoIt does now, after a small patch: https://git-send-email.io/#step-2 https://git-send-email.io/#step-2