Created
January 24, 2013 20:47
-
-
Save bergonom/4627560 to your computer and use it in GitHub Desktop.
Update to CSS for creating custom checkboxes and radio buttons. This CSS will allow the input elements to show that they have focus when the user accesses tabs through form elements. See the original article here: http://www.inserthtml.com/2012/06/custom-form-radio-checkbox
This file contains 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
/* Hide the checkbox offscreen */ | |
.regular-checkbox { | |
display: inline; | |
left: -8000px; | |
position: fixed; | |
} | |
/* Highlight the custom checkbox's border when the checkbox has focus. */ | |
.regular-checkbox:focus + label { | |
border: 1px solid #000; | |
} | |
/* Hide the radio button offscreen */ | |
.regular-radio { | |
display: inline; | |
left: -8000px; | |
position: fixed; | |
} | |
/* Highlight the custom radio button's border when the radio button has focus. */ | |
.regular-radio:focus + label { | |
border: 1px solid #000; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment