Skip to content

Instantly share code, notes, and snippets.

@KoryNunn
Last active December 11, 2015 05:29
Show Gist options
  • Select an option

  • Save KoryNunn/4552818 to your computer and use it in GitHub Desktop.

Select an option

Save KoryNunn/4552818 to your computer and use it in GitHub Desktop.
Pretty checkboxes.
.checkbox{
border-radius:2px;
border:1px solid rgba(0,0,0,0.3);
display:inline-block;
width:40px;
height:20px;
background:rgba(50,50,50,0.7);
box-shadow:inset 0 2px 5px rgba(0,0,0,0.3);
}
[type=checkbox]{
border-radius:2px;
border:1px solid black;
border-top:1px solid #999;
-webkit-appearance:none;
position:relative;
width:18px;
height:18px;
margin:1px;
left:0px;
background:rgba(0,0,0,0.5);
-webkit-transition: all 0.15s ease-out;
cursor:pointer;
}
[type=checkbox]:checked{
left:20px;
border:1px solid #0AF;
border-top:1px solid #7DF;
border-bottom:1px solid #03D;
background:rgba(0,110,255,0.7);
box-shadow:0 2px 5px rgba(0,0,0,0.3)
}
<!DOCTYPE html>
<html>
<head>
<link href="checkbox.css" rel="stylesheet" type="text/css"></link>
</head>
<body>
<span class="checkbox"><input type="checkbox"></input></span>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment