下面就来介绍简单的纯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">
<title>简单的纯CSS动画加载</title>
<style>
body{
background-color: #f5f5f5;
}
.loading{
width: 50px;
height: 50px;
border: 5px dotted #fff;
border-radius: 50%;
border-top: 5px dotted #6633ff;
border-left: 5px dotted #6633ff;
position: absolute;
left: 50%;
top: 50%;
margin-left: -25px;
margin-top: -25px;
animation: loading 1s ease infinite;
}
/* loading动画 */
@keyframes loading{
0%{
transform: rotate(0deg);
}
100%{
transform: rotate(360deg);
}
}
</style>
</head>
<body>
<div class="loading"></div>
</body>
</html>