tnblog
首页
视频
资源
登录

css实现动画效果案列:冒泡案列

7060人阅读 2019/6/6 19:30 总访问:118139 评论:0 收藏:0 手机
分类: 初吻给了奶嘴

css实现动画效果案列:冒泡案列


效果图:


代码:

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" />
  5. <title></title>
  6. <style type="text/css">
  7. body,html {
  8. width100%;
  9. height100px;
  10. background-color#9b59b6;
  11. margin0;
  12. padding0;
  13. }
  14. .bubbels {
  15. position: absolute;
  16. width100%;
  17. height100%;
  18. z-index0;
  19. overflow: hidden;
  20. top0;
  21. left0;
  22. }
  23. .bubble {
  24. position: absolute;
  25. bottom0;
  26. width40px;
  27. height40px;
  28. background#f1f1f1;
  29. border-radius50%;
  30. opacity0.1;
  31. animation:  flying 10s infinite ease-in;
  32. }
  33. .bubble:nth-child(1){
  34. width40px;
  35. height40px;
  36. left0%;
  37. animation-direction8s;
  38. }
  39. .bubble:nth-child(2){
  40. width20px;
  41. height20px;
  42. left20%;
  43. animation-direction10s;
  44. animation-delay2s;
  45. }
  46. .bubble:nth-child(3){
  47. width50px;
  48. height50px;
  49. left35%;
  50. animation-direction10s;
  51. animation-delay2s;
  52. }
  53. .bubble:nth-child(4){
  54. width80px;
  55. height80px;
  56. left50%;
  57. animation-direction7s;
  58. animation-delay0s;
  59. }
  60. .bubble:nth-child(5){
  61. width80px;
  62. height80px;
  63. left15%;
  64. animation-direction7s;
  65. animation-delay0s;
  66. }.bubble:nth-child(6){
  67. width60px;
  68. height60px;
  69. left35%;
  70. animation-direction6s;
  71. animation-delay2s;
  72. }.bubble:nth-child(7){
  73. width60px;
  74. height60px;
  75. left70%;
  76. animation-direction6s;
  77. animation-delay3s;
  78. }
  79. .bubble:nth-child(8){
  80. width5px;
  81. height5px;
  82. left25%;
  83. animation-direction4s;
  84. animation-delay0.25;
  85. }
  86. .bubble:nth-child(9){
  87. width70px;
  88. height70px;
  89. left80%;
  90. /*动画效果和持续的时间*/
  91. animation-direction12s;
  92. animation-delay4s;
  93. }
  94. .bubble:nth-child(10){
  95. width12px;
  96. height12px;
  97. left2%;
  98. animation-direction4s;
  99. animation-delay1s;
  100. }
  101. @keyframes flying{
  102. 0%{
  103. bottom: -100px;
  104. transformtranslateX(0);
  105. }
  106. 50%{
  107. transformtranslateX(100px);
  108. }
  109. 100%{
  110. bottom1000px;
  111. transformtranslateX(-200px);
  112. }
  113. }
  114. </style>
  115. </head>
  116. <body>
  117. <div class="bubbels">
  118. <div class="bubble"></div>
  119. <div class="bubble"></div>
  120. <div class="bubble"></div>
  121. <div class="bubble"></div>
  122. <div class="bubble"></div>
  123. <div class="bubble"></div>
  124. <div class="bubble"></div>
  125. <div class="bubble"></div>
  126. <div class="bubble"></div>
  127. <div class="bubble"></div>
  128. </div>
  129. </body>
  130. </html>


评价

css弹性盒子,flex布局

css弹性盒子由于版本不同浏览器问题造成了一些不同的写法display:flexbox;在google浏览器中如果使用下面的写法就不行displa...

css图片和文字对齐问题

文字和图片写到一排经常会出现对不齐的问题 这样感觉图片会上来一点没有和文字对齐,如下图 但是如果修改下html结...

css实现简单矩形对话框

在前端做项目时,我们可能会遇到写对话框的需求,这次做视频会议页面就遇到了,记录下日后有个参照。//网页部分 &lt;divcla...

如何修改css中存在的element.style内联样式

改腾讯地图的时候调整了下样式,发现样式一直存在问题,修改style里面的值,一点用都没有,html中这个值还找不到是在哪里出...

珍藏!! JS css不传之秘集合

&lt;!--其中5指每隔5秒刷新一次页面--&gt; &lt;metahttp-equiv=&quot;refresh&quot;content=&quot;5&quot;&gt; =========...

css中单位pxem,rem和vh/vw的理解

&gt;px像素(Pixel)。相对长度单位。像素px是相对于显示器屏幕分辨率而言的。em是相对长度单位。相对于当前对象内文本的字...

DIV+css网页布局常用的一些基础知识整理

一.文件命名规范全局样式:global.css;框架布局:layout.css;字体样式:font.css;链接样式:link.css;打印样式:print...

css相对定位与绝对定位

一般相对定位和绝对定位可以配合起来使用 例如实现如下的效果 只需要在外层div设置为相对定位,在内部设置为绝对定位就...

修改了css后,让浏览器从缓存中更新

当我们修改了css后,如果不做一些操作,浏览器是不会自动更新我们的样式文件的。除非是过期或者用户手动刷新清理缓存等。所...

css定位的简单运用

父容器使用相对定位position: relative子容器使用绝对定位position: relative这样就可以子容器相对父容器定位了,可以写一...

jscss异步加载

有些时候为了效率,我们需要js与css能够异步加载方法1:直接在后面加一个async的关键字&lt;scriptsrc=&quot;~/lib/jquery/d...

css3样式学习代码

上代码!上代码!不说了&lt;!DOCTYPEhtml&gt; &lt;htmllang=&quot;en&quot;&gt; &lt;head&gt; &lt;metacharset=&quot;UT...

html/css样式

代码: &lt;!DOCTYPEhtml&gt; &lt;html&gt; &lt;head&gt; &lt;metacharset=&quot;utf-8&quot;/&gt; &lt;title&gt...

css div水平居 。文字垂直居中 。flex的方式实现div的垂直与水平居中。布局模板

DIV等元素水平居中定宽度+margin:top auto可以让一个块级别元素在外层居中例如这样:效果:可以看到这个div已经居中了但是...

使用jquery操作元素的css样式(获取、修改等等)

使用jquery操作元素的css样式(获取、修改等等) //1、获取和设置样式 $(&quot;#tow&quot;).attr(&quot;class&quot;)...
大概你身上总有我喜欢的味道,所以我一见你就开心的笑
排名
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
欢迎加群交流技术
无论是丢下还是被丢下,都是一样痛苦的。