前言Hello!小伙伴!
首先非常感谢您阅读海轰的文章,倘若文中有错误的地方,欢迎您指出~
哈哈 自我介绍一下
昵称:海轰
标签:程序猿一只|C++选手|学生
简介:因C语言结识编程,随后转入计算机专业,有幸拿过国奖、省奖等,已保研 。目前正在学习C++/Linux(真的真的太难了~)
学习经验:扎实基础 + 多做笔记 + 多敲代码 + 多思考 + 学好英语!
日常分享:微信公众号【海轰Pro】记录生活、学习点滴,分享一些源代码或者学习资料,欢迎关注~
效果展示

文章插图
Demo代码HTML
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="https://tazarkount.com/read/style.css"><title>Document</title></head><body><section><span></span></section></body></html>CSShtml,body{margin: 0;height: 100%;}body{display: flex;justify-content: center;align-items: center;background: #263238;}section {width: 650px;height: 300px;padding: 10px;position: relative;display: flex;align-items: center;justify-content: center;/* 红色边框仅作提示 */border: 2px solid red;}span{width : 96px;height: 96px;border: 10px solid #fff;border-radius: 50%;display: flex;align-items: center;justify-content: center;position: relative;animation: rotation 1s linear infinite;}span::after{position: relative;content: '';display: inline-block;width:72px;height:72px;border-radius: 50%;border: 10px solid transparent;border-bottom-color: #FF3D00;}@keyframes rotation {0% { transform: rotate(0deg) }100% { transform: rotate(360deg)}}原理解释动画的核心部分就是span和span::after,section仅作为提示框 。步骤1将span元素设置为
- 一个96??96px的正方形
- 边框为10px,白色,solid
width : 96px;height: 96px;border: 10px solid #fff;效果图如下
文章插图
步骤2span::after伪元素设置为:
- 位于span正中
- 边长72??72px的正方形

文章插图
步骤3span::after设置
- 下边框:10px 红色 solid
border: 10px solid transparent;border-bottom-color: #FF3D00;
文章插图
步骤4span和span::after
- border-radius均设置为50%
border-radius: 50%;效果图如下
文章插图
步骤5为span添加动画
animation: rotation 1s linear infinite;/*动画实现*/@keyframes rotation {0% { transform: rotate(0deg) }100% { transform: rotate(360deg)}效果图如下
文章插图
结语学习来源:
https://codepen.io/bhadupranjal/pen/vYLZYqQ
css只会一点点,学习之余从喜欢看一些大神级别的css效果展示,根据源码一点一点学习知识点,文中有不对的地方,欢迎指出~
【「HTML+CSS」--自定义加载动画【006】】

文章插图
- 春季老年人吃什么养肝?土豆、米饭换着吃
- 三八妇女节节日祝福分享 三八妇女节节日语录
- 老人谨慎!选好你的“第三只脚”
- 校方进行了深刻的反思 青岛一大学生坠亡校方整改校规
- 脸皮厚的人长寿!有这特征的老人最长寿
- 长寿秘诀:记住这10大妙招 100%增寿
- 春季老年人心血管病高发 3条保命要诀
- 眼睛花不花要看四十八 老年人怎样延缓老花眼
- 香槟然能防治老年痴呆症? 一天三杯它人到90不痴呆
- 老人手抖的原因 为什么老人手会抖
