JSFiddle - React, Tailwind, and code Playground
CSS3 Checkbox Styles
by Jennifer Perrin
HTML
<h1>CSS3 Checkbox Styles</h1>
<div class="ondisplay">
<section>
<!-- Slide ONE -->
<div class="slideOne">
<input type="checkbox" value="None" id="slideOne" name="check" checked />
<label for="slideOne"></label>
</div>
</section>
<br />
<section>
<!-- Slide TWO -->
<div class="slideTwo">
<input type="checkbox" value="None" id="slideTwo" name="check" checked />
<label for="slideTwo"></label>
</div>
</section>
<section>
<!-- Slide THREE -->
<div class="slideThree">
<input type="checkbox" value="None" id="slideThree" name="check" checked />
<label for="slideThree"></label>
</div>
</section>
<br />
<section>
<!-- Rounded ONE -->
<div class="roundedOne">
<input type="checkbox" value="None" id="roundedOne" name="check" checked />
<label for="roundedOne"></label>
</div>
</section>
<section>
<!-- Rounded TWO -->
<div class="roundedTwo">
<input type="checkbox" value="None" id="roundedTwo" name="check" checked />
<label for="roundedTwo"></label>
</div>
</section>
<section>
<!-- Squared ONE -->
<div class="squaredOne">
<input type="checkbox" value="None" id="squaredOne" name="check" checked />
<label for="squaredOne"></label>
</div>
</section>
<br />
<section>
<!-- Squared TWO -->
<div class="squaredTwo">
<input type="checkbox" value="None" id="squaredTwo" name="check" checked />
<label for="squaredTwo"></label>
</div>
</section>
<section>
<!-- Squared THREE -->
<div class="squaredThree">
<input type="checkbox" value="None" id="squaredThree" name="check" checked />
<label for="squaredThree"></label>
</div>
</section>
<br />
<section>
<!-- Squared FOUR -->
<div class="squaredFour">
<input type="checkbox" value="None" id="squaredFour" name="check" checked />
<label for="squaredFour"></label>
</div>
</section>
</div>
CSS
body {
background: #555;
background-image: url('http://subtlepatterns.subtlepatterns.netdna-cdn.com/patterns/debut_dark.png');
}
h1, h2 {
color: #eee;
font: 30px Arial, sans-serif;
-webkit-font-smoothing: antialiased;
text-shadow: 0px 1px black;
text-align: center;
margin: 20px 0 20px 0;
}
.ondisplay{
text-align:center;
padding:0;
}
.ondisplay section{
width:100px;
height:75px;
background: #555;
display:inline-block;
border: 1px solid gray;
text-align: center;
margin-top:5px;
border-radius:5px;
box-shadow: 0 1px 4px
rgba(0, 0, 0, 0.3), 0 0 40px
rgba(0, 0, 0, 0.1) inset;
}
.ondisplay section::before {
color: #bbb;
font: 15px Arial, sans-serif;
-webkit-font-smoothing: antialiased;
text-shadow: 0px 1px black;
}
input[type=checkbox] {
visibility: hidden;
}
/* SLIDE ONE */
.slideOne {
width: 50px;
height: 10px;
background: #333;
margin: 35px auto;
-webkit-border-radius: 50px;
-moz-border-radius: 50px;
border-radius: 50px;
position: relative;
-webkit-box-shadow: inset 0px 1px 1px rgba(0,0,0,0.5), 0px 1px 0px rgba(255,255,255,0.2);
-moz-box-shadow: inset 0px 1px 1px rgba(0,0,0,0.5), 0px 1px 0px rgba(255,255,255,0.2);
box-shadow: inset 0px 1px 1px rgba(0,0,0,0.5), 0px 1px 0px rgba(255,255,255,0.2);
}
.slideOne label {
display: block;
width: 16px;
height: 16px;
-webkit-border-radius: 50px;
-moz-border-radius: 50px;
border-radius: 50px;
-webkit-transition: all .4s ease;
-moz-transition: all .4s ease;
-o-transition: all .4s ease;
-ms-transition: all .4s ease;
transition: all .4s ease;
cursor: pointer;
position: absolute;
top: -3px;
left: -3px;
-webkit-box-shadow: 0px 2px 5px 0px rgba(0,0,0,0.3);
-moz-box-shadow: 0px 2px 5px 0px rgba(0,0,0,0.3);
box-shadow: 0px 2px 5px 0px rgba(0,0,0,0.3);
background: #fcfff4;
background: -webkit-linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%);
background: -moz-linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%);
background:...