css 手写
# css 手写
# css 实现九宫格
flex 布局
float 布局
grid 布局
table 布局
# 如何画一条 0.5px 的线
- 采用 meta viewport 的方式
<meta name="viewport" content="width=device-width, initial-scale=0.5, minimum-scale=0.5, maximum-scale=0.5"/>
注意:viewport 只针对于移动端,只在移动端上才能看到效果
- transform: scale()
# CSS 实现 16:9 的盒子,不定宽
# css 实现 8 种三角形
https://www.cnblogs.com/chengxs/p/11406278.html (opens new window)
# css flex 实现骰子的六个面
https://www.cnblogs.com/ycherry/p/8184125.html (opens new window)
# css 实现进度条
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<style>
.circle_process {
position: relative;
width: 199px;
height: 200px;
}
.circle_process .wrapper {
width: 100px;
height: 200px;
position: absolute;
top: 0;
overflow: hidden;
}
.circle_process .right {
right: 0;
}
.circle_process .left {
left: 0;
}
.circle_process .circle {
width: 160px;
height: 160px;
border: 20px solid transparent;
border-radius: 50%;
position: absolute;
top: 0;
transform: rotate(-135deg);
}
.circle_process .rightcircle {
border-top: 20px solid green;
border-right: 20px solid green;
right: 0;
animation: circle_right 5s linear infinite;
-webkit-animation: circle_right 5s linear infinite;
}
.circle_process .leftcircle {
border-bottom: 20px solid green;
border-left: 20px solid green;
left: 0;
animation: circle_left 5s linear infinite;
-webkit-animation: circle_left 5s linear infinite;
}
@keyframes circle_right {
0% {
-webkit-transform: rotate(-135deg);
}
50%,
100% {
-webkit-transform: rotate(45deg);
}
}
@keyframes circle_left {
0%,
50% {
-webkit-transform: rotate(-135deg);
}
100% {
-webkit-transform: rotate(45deg);
}
}
</style>
</head>
<body>
<div class="circle_process">
<div class="wrapper right">
<div class="circle rightcircle"></div>
</div>
<div class="wrapper left">
<div class="circle leftcircle" id="leftcircle"></div>
</div>
</div>
</body>
</html>
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
参考:https://sevenhao.github.io/qhao/web/css-aritcle/css-property/CSS实现圆形进度条.html (opens new window)
更新时间: 2/10/2022, 7:21:32 PM