就是类似于这样,这个容器外面 有一条 线,然后围绕着这个容器慢慢的转动。
2 回答
Chris_威
TA贡献2条经验 获得超1个赞
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>rotate</title> </head> <style> *{ margin: 0; padding: 0; } .wrapper{ padding: 20px; position: relative; height: 250px; } .main{ height: 200px; width: 200px; margin: 25px auto; box-shadow: inset 0 0 0 1px rgba(105, 202, 98, 0.5); } .main , .main::before, .main::after { position: absolute; top: 0; bottom: 0; left: 0; right: 0; } .main::before, .main::after { content: ''; margin: -5%; box-shadow: inset 0 0 0 2px rgba(105, 202, 98, 0.5); animation: clip 8s linear infinite; } .main::before { animation-delay: 0s; } @keyframes clip { 0%, 100% { clip: rect(0px, 220.0px, 2px, 0px); } 25% { clip: rect(0px, 2px, 220.0px, 0px); } 50% { clip: rect(218.0px, 220.0px, 220.0px, 0px); } 75% { clip: rect(0px, 220.0px, 220.0px, 218.0px); } } </style> <body> <div class="wrapper"> <div class="main"></div> </div> </body> </html>
有个类似的,你参考参考
- 2 回答
- 0 关注
- 3873 浏览
相关问题推荐
添加回答
举报
0/150
提交
取消