This works for both iOS and Android! You can use almost the default checkbox-hack syntax and just need to add two things:
pseudo-class + general/adjacent sibling doesn't work on Android 4.1.2 so we need a hack:
body { -webkit-animation: bugfix infinite 1s; }
@-webkit-keyframes bugfix { from {padding:0;} to {padding:0;} }
Due to a bug on iOS it's not possible to click the label to toggle the input (checkbox), so we add an empty onclick
to the label:
<label for="button" onclick>click / touch</label>
(Sorry for this but CodePen parses the greater-than sign)
A Pen by Tim Pietrusky on CodePen.