Skip to content

Instantly share code, notes, and snippets.

@leongaban
Forked from arbales/gist:592332
Last active December 19, 2015 05:39
Show Gist options
  • Save leongaban/5905316 to your computer and use it in GitHub Desktop.
Save leongaban/5905316 to your computer and use it in GitHub Desktop.
Custom checkbox
<!-- http://jsfiddle.net/hM3s8/2/ -->
<html>
<head>
<title>Checkbox</title>
<style>
input[type=checkbox] {
display:none;
}
input[type=checkbox] + label
{
background: #999;
height: 16px;
width: 16px;
display:inline-block;
padding: 0 0 0 0px;
}
input[type=checkbox]:checked + label
{
background: #0080FF;
height: 16px;
width: 16px;
display:inline-block;
padding: 0 0 0 0px;
}
</style>
</head>
<body>
<input type='checkbox' name='thing' value='valuable' id="thing"/><label for="thing"></label>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment