draggabilly实现一个胶囊开关checkbox美化效果代码
代码语言:html
所属分类:表单美化
代码描述:draggabilly实现一个胶囊开关checkbox美化效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
/* Define active switch color */
/* Hide our checkboxes */
.check-switch input[type=checkbox] {
position: absolute;
opacity: 0;
}
label.check-switch {
clear: both;
color: #999;
display: inline-block;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
/* Default Track */
.check-switch input[type=checkbox] + .track {
vertical-align: middle;
width: 1.6588em;
height: 0.95em;
border: 1px solid rgba(0, 0, 0, 0.25);
border-radius: 999px;
background-color: rgba(0, 0, 0, 0.1);
-webkit-transition-duration: 0.3s;
-webkit-transition-property: background-color, box-shadow;
box-shadow: inset 0 0 0 0px rgba(102, 5, 199, 0.75);
margin: 0.5em 0 50px 0;
cursor: pointer;
}
/* Default Track Checked */
.check-switch input[type=checkbox]:checked + div {
background-color: #b36afb;
border: 1px solid rgba(102, 5, 199, 0.85);
box-shadow: inset 0 0 0 0.5em rgba(179, 106, 251, 0);
}
/* Default Knob */
.check-swit.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0