<style>
.switch-wrapper{
display: block;
right: 68px;
border-radius: 2px;
text-align: center;
color: #36383c;
cursor: pointer;
padding: 4px 8px;
height: 24px;
line-height: 20px;
background-color: rgb(0,95,129,.1);
}
.banner-switch{
width: 48px;
height:24px ;
color: #fff;
border-radius: 12px;
background-color: #03a9f0;
vertical-align: middle;
display: inline-block;
position: relative;
cursor: pointer;
}
.banner-switch-close{
width: 100%;
height: 100%;
border-radius: 12px;
background-color: #03a9f0;
color: #fff;
font-size: 12px;
line-height: 24px;
padding-left: 4px;
}
.banner-switch-btn{
position: absolute;
top: 1px;
left: calc(100%-21px);
width: 20px;
height: 20px;
border-radius: 50%;
border: 0.5px solid #999;
background-color: #fff;
transition: left .3s;
}
.right-switch{
left: 1px;
}
</style>
</head>
<body>
<div class="switch-wrapper">
<div class="banner-des">banner-des</div>
<div class="banner-switch">
<div class="banner-switch-close"></div>
<div class="banner-switch-btn"></div>
</div>
</div>
</body>
</html
css实现漂亮switch 开关
最新推荐文章于 2024-03-13 09:14:44 发布