<ul> <li><input type="checkbox" id="check1" class="check"><label for="check1" class="label"></label></li> <li><input type="checkbox" id="check2" class="check"><label for="check2" class="label"></label></li> <li><input type="checkbox" id="check3" class="check"><label for="check3" class="label"></label></li> <li><input type="checkbox" id="check4" class="check"><label for="check4" class="label"></label></li> <li><input type="checkbox" id="check5" class="check"><label for="check5" class="label"></label></li> <li><input type="checkbox" id="check6" class="check"><label for="check6" class="label"></label></li> <li><input type="checkbox" id="check7" class="check"><label for="check7" class="label"></label></li> </ul>
.check { display: none; } .label { width: 100%; height: 100%; color: #fff; text-shadow: 0 -1px 0 rgba(0, 0, 0, .2); background: #59f; display: block; box-shadow: 1px 1px 0 rgba(255, 255, 255, 1); transition: 350ms; } .check:checked + .label { background: #e67e22; -webkit-animation: onanime 750ms linear infinite alternate; } .label:before { content: 'OFF'; font-size: 14px; font-family: Helvetica; line-height: 34px; display: inline-block; transform: translate(10px); transition: 200ms; } .check:checked + .label:before { content: 'ON'; transform: translate(65px); } .label:after { content: ''; width: 48px; height: 32px; background: rgba(236, 240, 241, 1); border: 1px solid rgba(236, 240, 241, 1); display: block; cursor: pointer; box-sizing: border-box; transform: translate(51px, -33px); transition: 150ms; } .check:checked + .label:after { transform: translate(1px, -33px); } .label:hover:after { opacity: .8; } .label:active:after { border-color: rgba(189, 195, 199, 1); } @-webkit-keyframes onanime { 0% { background: #a9f; } 100% { background: #a5d; } }