-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcheckbox.css
54 lines (48 loc) · 1.21 KB
/
checkbox.css
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
50
51
52
53
54
body{
background-color: #8FBC8F;
padding: 0;/*The CSS padding properties are used to generate space around an element's content, inside of any defined borders.*/
margin: 0;/*The CSS margin properties are used to create space around elements, outside of any defined borders.*/
}
.box{
position: absolute;
top:50%;
left: 50%;
transform: translate(-50%, -50%);/*--The translate() method moves an element from its current position (according to the parameters given for the X-axis and the Y-axis).-->*/
}
input[type="checkbox"]{
display: none;
}
label{
position: relative;
color: #fff;
display: inline-block;/*This allows the text to wrap when it exceeds the element's width*/
cursor: pointer;
font-size: 100px;
}
label span{
position: relative;
top: 15px;
display: inline-block;
width: 90px;
height: 90px;
border: 5px solid #fff;
}
input[type="Checkbox"]:checked + label span:before{
content: "";
position: absolute;
top: 10px;
left: 10px;
bottom: 10px;
right: 10px;
background: #fff;
animation: ani 2s linear infinite;
}
/*@keyframes specifies the animation code.*/
@keyframes ani{
0%{
transform: rotate(0deg);
}
100%{
transform: rotate(360deg);
}
}