checkbox改el-switch
<input class="switch" type="checkbox" checked="checked" style="cursor: pointer" />
.switch {
appearance: none;
-moz-appearance: button;
-webkit-appearance: none;
}
.switch {
position: relative;
margin: 0;
width: 40PX;
height: 20PX;
border: 1PX solid
outline: 0;
border-radius: 10PX;
box-sizing: border-box;
background-color:
-webkit-transition: background-color 0.1s, border 0.1s;
transition: background-color 0.1s, border 0.1s;
}
.switch:before {
content: " ";
position: absolute;
top: 0;
left: 0;
width: 40PX;
height: 20PX;
border-radius: 10PX;
background-color:
-webkit-transition: -webkit-transform 0.35s cubic-bezier(0.45, 1, 0.4, 1);
transition: -webkit-transform 0.35s cubic-bezier(0.45, 1, 0.4, 1);
transition: transform 0.35s cubic-bezier(0.45, 1, 0.4, 1);
}
.switch:after {
content: " ";
position: absolute;
top: 0;
left: 1px;
width: 18PX;
height: 18PX;
border-radius: 15PX;
background-color:
/*box-shadow: 0 1PX 3PX rgba(0, 0, 0, 0.4);*/
-webkit-transition: -webkit-transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35);
transition: -webkit-transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35);
transition: transform 0.35s cubic-bezier(0.4, 0.4, 0.25, 1.35);
}
.switch:checked {
background:
border: solid 1px
}
.switch:checked:before {
transform: scale(0);
}
.switch:checked:after {
transform: translateX(19PX);
}