使用CSS3来实现Loading动画特效的代码案例分享
使用CSS3来实现Loading动画特效的代码案例分享
代码如下:
<!DOCTYPE html><html><head> <meta charset="UTF-8"> <title>css3 loading等待加载代码 - 何问起</title> <style> @keyframes move { from { transform: translate(0,50%); } to { transform: translate(0,850%); } } * { margin: 0; padding: 0; } body { min-width: 325px; height: 100vh; display: flex; flex-wrap: wrap; justify-content: space-around; align-items: center; align-content: flex-start; background: #2a2a2a; } figure { margin: 30px; width: 250px; height: 250px; border-radius: 50%; position: relative; background: #1c1c1c; } section { width: 10%; height: 100%; position: absolute; left: 45%; } section:nth-child(2) { transform: rotate(22.5deg); } section:nth-child(3) { transform: rotate(45deg); } section:nth-child(4) { transform: rotate(67.5deg); } section:nth-child(5) { transform: rotate(90deg); } section:nth-child(6) { transform: rotate(112.5deg); } section:nth-child(7) { transform: rotate(135deg); } section:nth-child(8) { transform: rotate(157.5deg); } figure p { height: 10%; border-radius: 50%; background: dodgerblue; animation: move 1s ease-in-out infinite alternate; } figure:nth-child(1) > section:nth-child(1) > p { animation-delay: -0.1875s; } figure:nth-child(1) > section:nth-child(2) > p { animation-delay: -0.175s; } figure:nth-child(1) > section:nth-child(3) > p { animation-delay: -0.1625s; } figure:nth-child(1) > section:nth-child(4) > p { animation-delay: -0.15s; } figure:nth-child(1) > section:nth-child(5) > p { animation-delay: -0.9375s; } figure:nth-child(1) > section:nth-child(6) > p { animation-delay: -0.925s; } figure:nth-child(1) > section:nth-child(7) > p { animation-delay: -0.9125s; } figure:nth-child(1) > section:nth-child(8) > p { animation-delay: -0.9s; } figure:nth-child(2) > section:nth-child(1) > p { animation-delay: -0.875s; } figure:nth-child(2) > section:nth-child(2) > p { animation-delay: -0.75s; } figure:nth-child(2) > section:nth-child(3) > p { animation-delay: -0.625s; } figure:nth-child(2) > section:nth-child(4) > p { animation-delay: -0.5s; } figure:nth-child(2) > section:nth-child(5) > p { animation-delay: -0.375s; } figure:nth-child(2) > section:nth-child(6) > p { animation-delay: -0.25s; } figure:nth-child(2) > section:nth-child(7) > p { animation-delay: -0.125s; } figure:nth-child(3) > section:nth-child(1) > p { animation-delay: -0.5s; } figure:nth-child(3) > section:nth-child(3) > p { animation-delay: -0.5s; } figure:nth-child(3) > section:nth-child(5) > p { animation-delay: -0.5s; } figure:nth-child(3) > section:nth-child(7) > p { animation-delay: -0.5s; } figure:nth-child(4) > section:nth-child(1) > p { animation-delay: -0.35s; } figure:nth-child(4) > section:nth-child(2) > p { animation-delay: -0.3s; } figure:nth-child(4) > section:nth-child(3) > p { animation-delay: -0.25s; } figure:nth-child(4) > section:nth-child(4) > p { animation-delay: -0.2s; } figure:nth-child(4) > section:nth-child(5) > p { animation-delay: -0.15s; } figure:nth-child(4) > section:nth-child(6) > p { animation-delay: -0.1s; } figure:nth-child(4) > section:nth-child(7) > p { animation-delay: -0.05s; } </style> <script src="js/prefixfree.min.js"></script></head><body> <figure> <section><p></p></section> <section><p></p></section> <section><p></p></section> <section><p></p></section> <section><p></p></section> <section><p></p></section> <section><p></p></section> <section><p></p></section> </figure> <figure> <section><p></p></section> <section><p></p></section> <section><p></p></section> <section><p></p></section> <section><p></p></section> <section><p></p></section> <section><p></p></section> <section><p></p></section> </figure> <figure> <section><p></p></section> <section><p></p></section> <section><p></p></section> <section><p></p></section> <section><p></p></section> <section><p></p></section> <section><p></p></section> <section><p></p></section> </figure> <figure> <section><p></p></section> <section><p></p></section> <section><p></p></section> <section><p></p></section> <section><p></p></section> <section><p></p></section> <section><p></p></section> <section><p></p></section> </figure> <p style="text-align:center;margin:50px 0; font:normal 14px/24px 'MicroSoft YaHei';"> <p>适用浏览器:360、FireFox、Chrome、Opera、傲游、搜狗、世界之窗. 不支持Safari、IE8及以下浏览器。</p> <p>来源:<a href="http://hovertree.com/" target="_blank">何问起</a></p> </p></body></html>
以上是使用CSS3来实现Loading动画特效的代码案例分享的详细内容。更多信息请关注PHP中文网其他相关文章!

热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

记事本++7.3.1
好用且免费的代码编辑器

SublimeText3汉化版
中文版,非常好用

禅工作室 13.0.1
功能强大的PHP集成开发环境

Dreamweaver CS6
视觉化网页开发工具

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)

热门话题

纯CSS3怎么实现波浪效果?本篇文章就来给大家介绍一下使用 SVG 和 CSS 动画制作波浪效果的方法,希望对大家有所帮助!

两种方法:1、利用display属性,只需给元素添加“display:none;”样式即可。2、利用position和top属性设置元素绝对定位来隐藏元素,只需给元素添加“position:absolute;top:-9999px;”样式。

在css中,可以利用border-image属性来实现花边边框。border-image属性可以使用图片来创建边框,即给边框加上背景图片,只需要将背景图片指定为花边样式即可;语法“border-image: url(图片路径) 向内偏移值 图像边界宽度 outset 是否重复;”。

怎么制作文字轮播与图片轮播?大家第一想到的是不是利用js,其实利用纯CSS也能实现文字轮播与图片轮播,下面来看看实现方法,希望对大家有所帮助!

实现方法:1、使用“:active”选择器选中鼠标点击图片的状态;2、使用transform属性和scale()函数实现图片放大效果,语法“img:active {transform: scale(x轴放大倍数,y轴放大倍数);}”。

在css3中,可以利用“animation-timing-function”属性设置动画旋转速度,该属性用于指定动画将如何完成一个周期,设置动画的速度曲线,语法为“元素{animation-timing-function:速度属性值;}”。

在前端开发中,我们经常会有一种场景:用户在与网页交互过程中需要等待数据的加载,此时通常会有一个loading效果显示,提醒用户等待。在Vue框架中,实现一个全局loading效果并不困难,下面我们来介绍一下如何实现。第一步:创建Vue插件我们可以创建一个名为loading的Vue插件,该插件可以在所有的Vue实例中引用。在插件中,我们需要实现以下两个方法:s
