Created
March 7, 2013 16:33
-
-
Save ultim8k/5109378 to your computer and use it in GitHub Desktop.
CheckBox Hack
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
/** | |
* CheckBox Hack | |
*/ | |
.field-container{ | |
position:relative; | |
display:table; | |
margin: 150px auto; | |
background-color: rgba(30,70,150,0.5); | |
padding:10px; | |
} | |
.checkbox-fuction{ | |
//width:0; | |
//height:0; | |
opacity:0; | |
font-size:0; | |
position:absolute; | |
left:-20px; | |
} | |
.checkbox-fuction:focus ~ .checkbox-appearence{ | |
box-shadow:0 0 5px black; | |
} | |
.checkbox-fuction:checked ~ .checkbox-appearence:after{ | |
position: absolute; | |
top:1px; | |
left:1px; | |
display:block; | |
width:10px; | |
height:10px; | |
color:black; | |
//background-color:red; | |
content: "\2714"; | |
color:black; | |
} | |
.checkbox-appearence{ | |
position:relative; | |
width:14px; | |
height:14px; | |
background-color:white; | |
margin-right: 10px; | |
display:inline-block; | |
cursor:pointer; | |
} | |
.checkbox-label{ | |
margin:0; | |
height:14px; | |
font-size:14px; | |
line-height:14px; | |
display:inline-block; | |
color:white; | |
} | |
.label-text{ | |
} |
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
<div class="field-container"> | |
<label class="checkbox-label" for="blah"><input class="checkbox-fuction" type="checkbox" name="blah" id="blah" /><div class="checkbox-appearence" for="blah"></div><span class="label-text">I have read and agree to the Terms & Conditions</span></label> | |
</div> |
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
//alert('Hello world!'); |
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
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment