自定义多选框

1
2
3
4
5
6
7
<div class="cell" >
<label class="el-checkbox">
<input type="checkbox" class="really-checkbox" >
<span class="checkbox-icon"></span>
<span class="label-text">多选框</span>
</label>
</div>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
.cell .really-checkbox,.cell .label-text,.cell .checkbox-icon{
vertical-align: middle;
}
.checkbox-icon {
display: inline-block;
position: relative;
border: 1px solid #bfcbd9;
border-radius: 4px;
box-sizing: border-box;
width: 18px;
height: 18px;
background-color: #fff;
z-index: 1;
transition: border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46);
}
.checkbox-icon::after {
-ms-transform: rotate(45deg) scaleY(1);
transform: rotate(45deg) scaleY(1);
}
.checkbox-icon::after{
box-sizing: content-box;
display: inline-block;
content: '';
border: 2px solid #fff;
border-left: 0;
border-top: 0;
height: 8px;
width:4px;
position: absolute;
top: 1px;
left: 5px;
transition: transform .15s cubic-bezier(.71,-.46,.88,.6) .05s;
-ms-transform-origin: center;
transform-origin: center;
}
input[type="checkbox"].really-checkbox:checked + .checkbox-icon{
background-color: #20a0ff;
border-color: #0190fe;
}
.really-checkbox {
visibility: hidden;
width:0;
}
文章目录
|