Skip to content

Instantly share code, notes, and snippets.

@digitalnature
Created May 11, 2013 01:11
Show Gist options
  • Save digitalnature/5558503 to your computer and use it in GitHub Desktop.
Save digitalnature/5558503 to your computer and use it in GitHub Desktop.
/**
* Custom checkboxes - http://stackoverflow.com/questions/16492722/customize-radio-box-like-in-my-concept
*/
body{
padding: 80px;
margin: 0;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 20px;
color: #333;
background-color: #fff;
}
input[type='radio']{
display: none;
}
label{
border: 1px solid #ddd;
padding: 10px;
position: relative;
padding-left: 36px;
}
label::before{
position: absolute;
left: 10px;
top: 10px;
content: '';
box-shadow: 0px 0px 2px #999;
border: 2px solid #fff;
width: 12px;
height: 12px;
}
input:checked + label::before{
background: #ccc;
}
<input type="radio" name="foo" id="c1" /> <label for="c1">Uberwtf</label>
<input type="radio" name="foo" id="c2" /> <label for="c2">Paypal</label>
<input type="radio" name="foo" id="c3" /> <label for="c3">+5%</label>
<input type="radio" name="foo" id="c4" /> <label for="c4">Bitcoin</label>
// alert('Hello world!');
{"view":"split","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