Created
February 10, 2012 07:29
-
-
Save argyleink/1787412 to your computer and use it in GitHub Desktop.
Checkbox Hack for button with what could be a faux :selected
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
.transparent { opacity:0; } | |
.absolute { position:absolute; } | |
/* Toggled State */ | |
label { | |
box-shadow:inset 0px 1px 0px 0px #ffffff; | |
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ededed), color-stop(1, #dfdfdf) ); | |
background-color:#ededed; | |
border-radius:6px; | |
border:1px solid #dcdcdc; | |
color:#777777; | |
font-weight:bold; | |
font-family:sans-serif; | |
font-size:15px; | |
text-align:center; | |
padding:6px 24px; | |
text-decoration:none; | |
text-shadow:1px 1px 0px #ffffff; | |
display:inline-block; | |
transition:padding 0.3s ease-in-out; | |
} | |
/* Toggled State */ | |
input[type=checkbox]:checked ~ label { | |
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ededed), color-stop(1, #ffffff) ); | |
padding:50px 120px; | |
} |
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
<div class="relative"> | |
<input id="toggle-1" type="checkbox" class="transparent absolute"> | |
<label for="toggle-1">I'm a toggle</label> | |
</div> |
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
{"view":"split-vertical","prefixfree":"1","page":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment