3 ms·
You don't have to hide the checkbox like that; display: none; is fine. Also looks better code-wise. And apparently performance wise: http://www.zeldman.com/20
by Svip 14y ago
You don't have to hide the checkbox like that; display: none; is fine. Also looks better code-wise.
And apparently performance wise: http://www.zeldman.com/2012/03/01/replacing-the-9999px-hack-new-image-replacement/ http://www.zeldman.com/2012/03/01/replacing-the-9999px-hack-...
- denzeldenzel 14y agodisplay:none will be problematic for mobile Safari since the label click won't trigger the checkbox to be checked. The 100% text-indent snippet from that article on zeldman.com does not seem to work when applied to a checkbox... it remains visible.
- talmand 14y agoAnother way is to put the checkbox within the label and absolute position it to the outside of the label's box. With the label having a relative position and hidden overflow you shouldn't see the checkbox. But this may not be suitable based on the design and other factors. Plus I haven't browser checked it since I would normally do such things with Javascript.