CSS3如何实现loading预加载动画特效
发表于:2026-11-02 作者:千家信息网编辑
千家信息网最后更新 2026年11月02日,小编给大家分享一下CSS3如何实现loading预加载动画特效,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!该loadin
千家信息网最后更新 2026年11月02日CSS3如何实现loading预加载动画特效
小编给大家分享一下CSS3如何实现loading预加载动画特效,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!
该loading特效共有4种不同的效果,分别通过不同的CSS3 keyframes帧动画来完成。
HTML结构
4种loading预加载动画的HTML结构分别如下:
CSS样式
然后分别为它们添加下面的CSS样式。
/* KEYFRAMES */ @keyframes spin { from { transform: rotate(0); } to{ transform: rotate(359deg); }} @keyframes configure-clockwise { 0% { transform: rotate(0); } 25% { transform: rotate(90deg); } 50% { transform: rotate(180deg); } 75% { transform: rotate(270deg); } 100% { transform: rotate(359deg); }} @keyframes configure-xclockwise { 0% { transform: rotate(45deg); } 25% { transform: rotate(-45deg); } 50% { transform: rotate(-135deg); } 75% { transform: rotate(-215deg); } 100% { transform: rotate(-305deg); }} @keyframes pulse { from { opacity: 1; transform: scale(1); } to { opacity: .25; transform: scale(.75); }} /* GRID STYLING */ * { box-sizing: border-box;} body { min-height: 100vh; background-color: #37474f; display: flex; justify-content: space-between; flex-wrap: wrap; align-items: flex-start;} .spinner-box { width: 300px; height: 300px; display: flex; justify-content: center; align-items: center; background-color: transparent;} /* SPINNING CIRCLE */ .circle-border { width: 150px; height: 150px; padding: 3px; display: flex; justify-content: center; align-items: center; border-radius: 50%; background: rgb(63,249,220); background: linear-gradient(0deg, rgba(63,249,220,0.1) 33%, rgba(63,249,220,1) 100%); animation: spin .8s linear 0s infinite;} .circle-core { width: 100%; height: 100%; background-color: #37474f; border-radius: 50%;} /* X-ROTATING BOXES */ .configure-border-1 { width: 115px; height: 115px; padding: 3px; position: absolute; display: flex; justify-content: center; align-items: center; background: #ffab91; animation: configure-clockwise 3s ease-in-out 0s infinite alternate;} .configure-border-2 { width: 115px; height: 115px; padding: 3px; left: -115px; display: flex; justify-content: center; align-items: center; background: rgb(63,249,220); transform: rotate(45deg); animation: configure-xclockwise 3s ease-in-out 0s infinite alternate;} .configure-core { width: 100%; height: 100%; background-color: #37474f;} /* PULSE BUBBLES */ .pulse-container { width: 120px; display: flex; justify-content: space-between; align-items: center;} .pulse-bubble { width: 20px; height: 20px; border-radius: 50%; background-color: #3ff9dc;} .pulse-bubble-1 { animation: pulse .4s ease 0s infinite alternate;}.pulse-bubble-2 { animation: pulse .4s ease .2s infinite alternate;}.pulse-bubble-3 { animation: pulse .4s ease .4s infinite alternate;} /* SOLAR SYSTEM */ .solar-system { width: 250px; height: 250px; display: flex; justify-content: center; align-items: center;} .orbit { position: relative; display: flex; justify-content: center; align-items: center; border: 1px solid #ffffffa5; border-radius: 50%;} .earth-orbit { width: 165px; height: 165px; -webkit-animation: spin 12s linear 0s infinite;} .venus-orbit { width: 120px; height: 120px; -webkit-animation: spin 7.4s linear 0s infinite;} .mercury-orbit { width: 90px; height: 90px; -webkit-animation: spin 3s linear 0s infinite;} .planet { position: absolute; top: -5px; width: 10px; height: 10px; border-radius: 50%; background-color: #3ff9dc;} .sun { width: 35px; height: 35px; border-radius: 50%; background-color: #ffab91;}以上是"CSS3如何实现loading预加载动画特效"这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注行业资讯频道!
动画
特效
篇文章
不同
内容
样式
结构
不怎么
大部分
效果
更多
知识
行业
资讯
资讯频道
面的
频道
别为
参考
学习
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
互联网科技产业
西安纸贵互联网科技有限公司
互联网是不是新科技
互联网金融 金融科技
互联网未来科技
万易互联网科技有限公司
奇酷互联网络科技
奇士达互联网科技
山东吉时兔互联网科技有限公司
互联网和黑科技的看法
威龙国际互联网科技公司
明优互联网科技有限公司
上海钢联属于互联网科技股吗
江苏苏星互联网科技有限公司
皮皮虾互联网科技有限公司
互联网风格科技公司名称
互联网科技接地气
科技和互联网行业的特点
陕西彩京云互联网科技有限公司
伍佰万互联网科技是干嘛的
互联网科技会
喔噻互联网科技
碳银互联网科技
亿策互联网科技
无线互联网科技
多迪互联网科技有限公司
玉溪互联网科技怎么选
本届互联网博览会上的黑科技
伍佰万互联网科技怎么赚钱
中国互联网公司的科技投入