css3旋转小样例
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
body{
background-color: #000;
}
.dibu {
width: 500px;
height: 500px;
/* background-color: #fff; */
margin: 100px auto;
border-radius: 50%;
border: 20px solid #aca;
position: relative;
animation: xuanzhuan 2s linear infinite;
}
.dibu::before{
content: '';
display: block;
width: 500px;
height: 500px;
border-radius: 50%;
border-top: 20px solid rgb(230, 255, 2);
border-left: 20px solid rgb(230, 255, 2);
border-right: 20px solid transparent;
border-bottom: 20px solid transparent;
position: absolute;
top: -20px;
left: -20px;
}
.r{
width: 250px;
height: 20px;
/* background-color:rgb(230, 255, 2); */
background-color: transparent;
position: absolute;
top: 241px;
transform: rotate(136deg);
transform-origin: right;
}
.r::before{
content: '';
display: block;
background-color:rgb(230, 255, 2);
width: 50px;
height: 50px;
border-radius: 50%;
position: absolute;
top:-14px;
left: -34px;
}
@keyframes xuanzhuan {
0%{transform: rotate(0deg);}
100%{ transform: rotate(360deg);}
}
</style>
</head>
<body>
<!-- 固定大圈 -->
<div class="dibu">
<div class="r"></div>
</div>
</body>
</html>
本文作者:张尊娟
本文链接:https://www.cnblogs.com/wszzj/p/14109518.html
版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步