加油~<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>进度条</title>
<style type="text/css">
/* 清除样式 调整位置 */
* {
margin:0;
padding:0;
}
body {
background:#2ecc71;
margin:100px;
}
/* 最底层 */
.load {
position:relative;
text-indent:-9999px; /*隐藏文字方法之一*/
width:222px;
height:222px;
background: #9b59b6;
box-shadow:inset 0 0 0 15px #6FE;
border-radius:50%;
}
/*中间层*/
.load::before {
content:'';
width:111px;
height:111px;
background:rgba(52, 152, 219);
position:absolute;
left:111px;
border-radius:0 111px 0 0;
}
/*最顶层*/
.load::after {
content:'';
position: absolute;
width:222px;
height:222px;
box-shadow: inset 0 0 0 15px rgba(255,255,255,.5);
left:0;
border-radius:50%;
}
/* 设定动画 */
@keyframes flash{
0% {
transform: rotate(0deg);
}
25% {
transform: rotate(90deg);
}
50% {
transform: rotate(180deg);
}
75% {
transform: rotate(270deg);
}
100% {
transform: rotate(360deg);
}
}
/* 载入动画 并固定动画位置 */
.load::before {
animation: flash 2.5s infinite linear;
transform-origin:0px 111px;
}
/* 覆盖样式 实现画面 注释内容,更清晰*/
body {
background: #000;
}
.load {
background: none;
}
.load::before {
background: #000;
}
</style>
</head>
<body>
<div class="load">Loading</div>
</body>
</html>
|