
css实现动画效果案列:冒泡案列
效果图:
代码:
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8" />
- <title></title>
- <style type="text/css">
- body,html {
- width: 100%;
- height: 100px;
- background-color: #9b59b6;
- margin: 0;
- padding: 0;
- }
-
- .bubbels {
- position: absolute;
- width: 100%;
- height: 100%;
- z-index: 0;
- overflow: hidden;
- top: 0;
- left: 0;
- }
- .bubble {
- position: absolute;
- bottom: 0;
- width: 40px;
- height: 40px;
- background: #f1f1f1;
- border-radius: 50%;
- opacity: 0.1;
- animation: flying 10s infinite ease-in;
- }
-
- .bubble:nth-child(1){
- width: 40px;
- height: 40px;
- left: 0%;
- animation-direction: 8s;
- }
- .bubble:nth-child(2){
- width: 20px;
- height: 20px;
- left: 20%;
- animation-direction: 10s;
- animation-delay: 2s;
- }
- .bubble:nth-child(3){
- width: 50px;
- height: 50px;
- left: 35%;
- animation-direction: 10s;
- animation-delay: 2s;
- }
-
- .bubble:nth-child(4){
- width: 80px;
- height: 80px;
- left: 50%;
- animation-direction: 7s;
- animation-delay: 0s;
- }
-
- .bubble:nth-child(5){
- width: 80px;
- height: 80px;
- left: 15%;
- animation-direction: 7s;
- animation-delay: 0s;
- }.bubble:nth-child(6){
- width: 60px;
- height: 60px;
- left: 35%;
- animation-direction: 6s;
- animation-delay: 2s;
- }.bubble:nth-child(7){
- width: 60px;
- height: 60px;
- left: 70%;
- animation-direction: 6s;
- animation-delay: 3s;
- }
- .bubble:nth-child(8){
- width: 5px;
- height: 5px;
- left: 25%;
- animation-direction: 4s;
- animation-delay: 0.25;
- }
- .bubble:nth-child(9){
- width: 70px;
- height: 70px;
- left: 80%;
- /*动画效果和持续的时间*/
- animation-direction: 12s;
- animation-delay: 4s;
- }
- .bubble:nth-child(10){
- width: 12px;
- height: 12px;
- left: 2%;
- animation-direction: 4s;
- animation-delay: 1s;
- }
- @keyframes flying{
- 0%{
- bottom: -100px;
- transform: translateX(0);
- }
-
- 50%{
- transform: translateX(100px);
- }
-
- 100%{
- bottom: 1000px;
- transform: translateX(-200px);
- }
- }
- </style>
- </head>
- <body>
- <div class="bubbels">
- <div class="bubble"></div>
- <div class="bubble"></div>
- <div class="bubble"></div>
- <div class="bubble"></div>
- <div class="bubble"></div>
- <div class="bubble"></div>
- <div class="bubble"></div>
- <div class="bubble"></div>
- <div class="bubble"></div>
- <div class="bubble"></div>
- </div>
- </body>
- </html>
评价
排名
30
文章
18
粉丝
6
评论
11
vs code 插件安装推荐
修心 :
背景的妹子好评啊!
如何完全干净的卸载 vs code编辑器
剑轩 :
vs code插件这么顽强的么
广告终结插件推荐
剑轩 : 我好像也是用的这个
windoes 强力下载工具Internet Download Manager
饰心 : 线程不要开多了 开多了要遭网站拉黑
推荐一款三无压缩软件:bandizip
瑾语 : 用过 感觉没rar好用
修改电脑的鼠标指针样式
剑轩 : 挺喜欢你这个个性签名的
ICP备案 :渝ICP备18016597号-1
网站信息:2018-2025TNBLOG.NET
技术交流:群号656732739
联系我们:contact@tnblog.net
公网安备:
50010702506256


欢迎加群交流技术