Created
July 1, 2012 19:16
-
-
Save duncanmcdougall/3029298 to your computer and use it in GitHub Desktop.
iOS switch styled check boxes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE HTML> | |
| <html lang="en-US"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <style> | |
| body | |
| { | |
| margin:40px; | |
| } | |
| input[type="checkbox"] | |
| { | |
| position:absolute; | |
| left:-9999px; | |
| top:-9999px; | |
| } | |
| label | |
| { | |
| display:block; | |
| width:77px; | |
| height:27px; | |
| background: url('http://s11.postimage.org/rxp1lfdc3/switch.png') right center no-repeat; | |
| background-size:128px 27px; | |
| border-radius:14px; | |
| transition: background-position 0.2s; | |
| -webkit-transition: background-position 0.2s; | |
| border-right:1px solid #ccc; | |
| border-left:1px solid #ccc; | |
| } | |
| input[type="checkbox"]:checked+label | |
| { | |
| background-position:left center; | |
| } | |
| | |
| </style> | |
| </head> | |
| <body> | |
| <input type="checkbox" id="cb" /> | |
| <label for="cb"></label> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment