Skip to content
All gists
Back to GitHub
Sign in
Sign up
Sign in
Sign up
{{ message }}
Instantly share code, notes, and snippets.
claudia-romano
/
custom-checkbox-radio-buttons.css
Last active
November 8, 2017 10:27
Star
0
Fork
0
Star
Code
Revisions
2
Embed
What would you like to do?
Embed
Embed this gist in your website.
Share
Copy sharable link for this gist.
Clone via HTTPS
Clone with Git or checkout with SVN using the repository’s web address.
Learn more about clone URLs
Download ZIP
Raw
custom-checkbox-radio-buttons.css
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
Show hidden characters
.js .nc-button-wrapper {
position: relative;
}
.js .nc-button-wrapper input[type=radio],
.js .nc-button-wrapper input[type=checkbox] {
/* hide native checkbox and radio input if JavaScript is enabled */
position: absolute;
left: 0;
top: 0;
margin: 0;
padding: 0;
opacity: 0;
}
.nc-button-wrapper svg {
/* svg icon is hidden by default */
display: none;
}
.js .nc-button-wrapper svg {
/* show custom svg icon if JavaScript is enabled */
display: block;
position: absolute;
/* IE9 and IE10 support pointer-events on SVG elements while they don't support it on HTML elements */
pointer-events: none;
left: 0;
top: 50%;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%);
}
.js .nc-button-wrapper label {
position: relative;
padding-left: 20px;
}
Sign up for free
to join this conversation on GitHub
. Already have an account?
Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.