Skip to content

Instantly share code, notes, and snippets.

@ultim8k
Created March 7, 2013 16:33
Show Gist options
  • Save ultim8k/5109378 to your computer and use it in GitHub Desktop.
Save ultim8k/5109378 to your computer and use it in GitHub Desktop.
CheckBox Hack
/**
* 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{
}
<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 &amp; Conditions</span></label>
</div>
//alert('Hello world!');
{"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