原文地址:https://segmentfault.com/a/1190000015295466

感想:重点在小球绕环转动。

HTML code:

<div class="container">
<div class="ring"></div>
<div class="spheres">
<span class="sphere"></span>
<span class="sphere"></span>
<span class="sphere"></span>
</div>
</div>

CSS code:

html, body {
margin:;
padding:;
}
body {
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
background-color: darkslategray;
}
/* 改变盒模型 为元素设定的宽度和高度包括了外内外边距 */
*{
box-sizing: border-box;
}
/* 画出圆环 */
.container{
position: relative;
font-size: 20px;
/* 最后,让容器转动起来,制造小球围绕圆环盘旋的效果 */
animation: rotate 5s linear infinite;
}
.ring{
position: relative;
width: 10em;
height: 10em;
border: 1.5em solid paleturquoise;
border-radius: 50%;
z-index:;
}
/* 在圆环的左上方画出一个小球 */
.sphere{
position: absolute;
top: -20%;
left: -20%;
/* 让小球盘旋 */
width: 80%;
height: 80%;
animation:
rotate 1.5s linear infinite,
overlapping 1.5s linear infinite;
}
/* 通过设置动画延时,制造 3 个小球同时盘旋的效果 */
.sphere:nth-child(2){
animation-delay: -0.5s;
}
.sphere:nth-child(3) {
animation-delay: -1s;
}
@keyframes rotate{
to{
transform: rotate(360deg);
}
}
/* 让小球的圆环的上下穿梭 */
@keyframes overlapping {
to {
z-index:;
}
}
.sphere::after{
content: '';
position: absolute;
width: 3em;
height: 3em;
border-radius: 50%;
background-color: lightseagreen;
}

最新文章

  1. ejoy2d源码阅读笔记1
  2. Qt之qInstallMessageHandler(重定向至文件)
  3. [译]对 AngularJS 模板的A/B测试
  4. IOS searchBar去掉背景
  5. Oracle之存储过程
  6. 【转】研华Adam6060某段时间后无法连接的问题
  7. 接口设计ie常见的问题
  8. iOS11UINavigationBar的item左右间距调整
  9. Java多线程之线程的控制
  10. 【Python篇】---Python3.5在Centoos的安装教程--超实用
  11. NodeJS NPM 镜像使用方法
  12. 关于JS中的常用表单验证+正则表达式
  13. 【转】像素 Pixel (Picture Element)
  14. LeetCode题解之 Find the Town Judge
  15. git与eclipse集成之更新特性分支代码到个人特性分支
  16. Cow Acrobats [POJ3045] [贪心]
  17. nginx的高可用集群
  18. zabbix 自动发现
  19. 环境变量篇getenv putenv setenv
  20. python学习之路 八 :面向对象编程基础

热门文章

  1. HTML和CSS的静态页面
  2. NGINX 资料
  3. 关于Nginx配置性能优化
  4. ALGO-117_蓝桥杯_算法训练_友好数
  5. Qt学习——QListWidget控件的使用
  6. vue请求拦截
  7. nodejs选择JavaScript作为开发语言,是因为一般的开发语言的标准库都是带有IO模块的,并且通常这个 模块是阻塞性的,所以nodejs选择了没有自带IO模块的Javascript
  8. 【原创】Docker实战 Dockerfile最佳实践&amp;&amp;容器之间通信
  9. [UE4]C++中的注释
  10. vue 绑定属性 绑定Class 绑定style