Skip to content

Instantly share code, notes, and snippets.

@derekjohnson
Forked from anonymous/dabblet.css
Created June 1, 2012 16:11
Show Gist options
  • Save derekjohnson/2853254 to your computer and use it in GitHub Desktop.
Save derekjohnson/2853254 to your computer and use it in GitHub Desktop.
Styling radio buttons
/**
* Styling radio buttons
*/
label {
display:inline-block;
padding: 1em;
background: #faf;
}
[type=radio] {
position: absolute;
top: -999em;
}
[type=radio]:checked+label {
background: #aff;
}
[type=radio]:not(:checked)+label {
background: #faf;
}
<!-- content to be placed inside <body>…</body> -->
<body>
<input type="radio" id="radio1" name="radio">
<label for="radio1">label</label>
<input type="radio" id="radio2" name="radio">
<label for="radio2">label 2</label>
<body>
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment