至今HTML5我国早已为大伙儿共享过几百种根据 CSS3 的Loading载入动漫,实际效果炫酷编码简约,十分值得学习培训效仿;今日就先给大伙儿共享两个常见的CSS3的Loading的实例。
第1种实际效果:
HTML一部分
XML/HTML Code拷贝內容到剪贴板
- <div class="loading">
- <span></span>
- <span></span>
- <span></span>
- <span></span>
- <span></span>
- </div>
CSS3一部分
CSS Code拷贝內容到剪贴板
- .loading{
- width: 80px;
- height: 40px;
- margin: 0 auto;
- margin-top:100px;
- }
- .loading span{
- display: inline-block;
- width: 8px;
- height: 100%;
- border-radius: 4px;
- background: lightgreen;
- -webkit-animation: load 1s ease infinite;
- }
- @-webkit-keyframes load{
- 0%,100%{
- height: 40px;
- background: lightgreen;
- }
- 50%{
- height: 70px;
- margin: -15px 0;
- background: lightblue;
- }
- }
- .loading span:nth-child(2){
- -webkit-animation-delay:0.2s;
- }
- .loading span:nth-child(3){
- -webkit-animation-delay:0.4s;
- }
- .loading span:nth-child(4){
- -webkit-animation-delay:0.6s;
- }
- .loading span:nth-child(5){
- -webkit-animation-delay:0.8s;
- }
第2种实际效果:
HTML一部分
XML/HTML Code拷贝內容到剪贴板
- <div class="loadEffect">
- <span></span>
- <span></span>
- <span></span>
- <span></span>
- <span></span>
- <span></span>
- <span></span>
- <span></span>
- </div>
CSS3一部分
CSS Code拷贝內容到剪贴板
- .loadEffect{
- width: 100px;
- height: 100px;
- position: relative;
- margin: 0 auto;
- margin-top:100px;
- }
- .loadEffect span{
- display: inline-block;
- width: 16px;
- height: 16px;
- border-radius: 50%;
- background: lightgreen;
- position: absolute;
- -webkit-animation: load 1.04s ease infinite;
- }
- @-webkit-keyframes load{
- 0%{
- opacity: 1;
- }
- 100%{
- opacity: 0.2;
- }
- }
- .loadEffect span:nth-child(1){
- left: 0;
- top: 50%;
- margin-top:-8px;
- -webkit-animation-delay:0.13s;
- }
- .loadEffect span:nth-child(2){
- left: 14px;
- top: 14px;
- -webkit-animation-delay:0.26s;
- }
- .loadEffect span:nth-child(3){
- left: 50%;
- top: 0;
- margin-left: -8px;
- -webkit-animation-delay:0.39s;
- }
- .loadEffect span:nth-child(4){
- top: 14px;
- rightright:14px;
- -webkit-animation-delay:0.52s;
- }
- .loadEffect span:nth-child(5){
- rightright: 0;
- top: 50%;
- margin-top:-8px;
- -webkit-animation-delay:0.65s;
- }
- .loadEffect span:nth-child(6){
- rightright: 14px;
- bottombottom:14px;
- -webkit-animation-delay:0.78s;
- }
- .loadEffect span:nth-child(7){
- bottombottom: 0;
- left: 50%;
- margin-left: -8px;
- -webkit-animation-delay:0.91s;
- }
- .loadEffect span:nth-child(8){
- bottombottom: 14px;
- left: 14px;
- -webkit-animation-delay:1.04s;
- }
上面这两个全是大伙儿常见的载入实际效果,下面的就不依依的实际编码了,有必须的小伙子伴请给我留言!
更多实际效果以下所示:
第3种loading实际效果
第4种loading实际效果
第5种loading实际效果
第6种loading实际效果
第7种loading实际效果
这些实际效果全是用CSS3完成的,是否很强大,要想学习培训的小伙子伴记得给我留言哦!假如大伙儿有更牛气的实际效果记得悄悄的发给我哦!
以上这篇CSS3轻轻松松完成清爽 Loading 实际效果的简易案例便是网编共享给大伙儿的所有內容了,期待能给大伙儿1个参照,也期待大伙儿多多适用脚本制作之家。