<!DOCTYPE html>
<html>
<head>
<title>switch开关按钮</title>
<style type="text/css">
#checked {
width: 60px;
position: relative;
margin: 20px auto;
}
.labelBox {
margin-bottom: 20px;
background: #409eff;
border-radius: 40px;
width: 60px;
position: relative;
height: 32px;
}
.check {
display: block;
width: 30px;
height: 30px;
border-radius: 50%;
background: #fff ;
border: 1px solid #e5e5e5;
position: absolute;
top: 0px;
left: 0px;
}
input[type=checkbox] {
border: 0 none !important;
clip: rect(1px,1px,1px,1px);
height: 1px !important;
overflow: hidden !important;
position: absolute !important;
width: 1px !important;
}
@keyframes labelON {
0% {
top: 0px;
left: 0px;
}
100% {
top: 0px;
left: 28px;
}
}
css写一个原生switch开关按钮
最新推荐文章于 2024-04-11 11:44:47 发布