HTML5技术

css3动画animation - danran68(21)

字号+ 作者:H5之家 来源:H5之家 2016-10-29 13:00 我要评论( )

1 /*移动的星星 animation*/ 2 @keyframes star_yidong{ 3 0 %{ background-position:0% 0%; background-color:#fff;} 4 50 %{ background-position:50% 0%; background-color:#CCC;} 5 100%{ background-position:

1 /*移动的星星 animation*/ 2 @keyframes star_yidong{ 3 0 %{ background-position:0% 0%; background-color:#fff;} 4 50 %{ background-position:50% 0%; background-color:#CCC;} 5 100%{ background-position:100% 0%; background-color:#000;} 6 } 7 @-webkit-keyframes star_yidong{ 8 0 %{ background-position:0% 0%; background-color:#fff;} 9 50 %{ background-position:50% 0%; background-color:#CCC;} 10 100%{ background-position:100% 0%; background-color:#000;} 11 } 12 @-moz-keyframes star_yidong{ 13 0 %{ background-position:0% 0%; background-color:#fff;} 14 50 %{ background-position:50% 0%; background-color:#CCC;} 15 100%{ background-position:100% 0%; background-color:#000;} 16 } 17 @-o-keyframes star_yidong{ 18 0 %{ background-position:0% 0%; background-color:#fff;} 19 50 %{ background-position:50% 0%; background-color:#CCC;} 20 100%{ background-position:100% 0%; background-color:#000;} 21 } 22 .move_star{ position:relative; width:100%; height:600px; margin:0 auto; margin-top:20px} 23 .star_01{ position:absolute; left:0; right:0; top:0; bottom:0; margin:auto} 24 #xing01{ 25 background:url(img/background.png) repeat; z-index:4; 26 animation:star_yidong 60s linear infinite; 27 -webkit-animation:star_yidong 60s linear infinite; 28 -moz-animation:star_yidong 60s linear infinite; 29 -o-animation:star_yidong 60s linear infinite; 30 } 31 #xing02{ 32 background:url(img/foreground.png) repeat; z-index:4; 33 animation:star_yidong 80s linear infinite; 34 -webkit-animation:star_yidong 80s linear infinite; 35 -moz-animation:star_yidong 80s linear infinite; 36 -o-animation:star_yidong 80s linear infinite; 37 } 38 #xing03{ 39 background:url(img/midground.png) repeat; z-index:4; 40 animaition:star_yidong 100s ease-in infinite; 41 -webkit-animation:star_yidong 100s ease-in infinite; 42 -moz-animation:star_yidong 100s ease-in infinite; 43 -o-animation:star_yidong 100s ease-in infinite; 44 } 45 /*闪动的星星*/ 46 #xing04{ 47 background:url(img/stars.png) repeat; z-index:4; 48 } 49 #xing05{ 50 background:url(img/twinkling.png) repeat; z-index:4; 51 animaition:move-twink-back 200s linear infinite; 52 -webkit-animation:move-twink-back 200s linear infinite; 53 -moz-animation:move-twink-back 200s linear infinite; 54 -o-animation:move-twink-back 200s linear infinite; 55 } 56 @keyframes move-twink-back { 57 from {background-position:0 0;} 58 to {background-position:1000px 5000px;} 59 } 60 @-webkit-keyframes move-twink-back { 61 from {background-position:0 0;} 62 to {background-position:1000px 5000px;} 63 } 64 @-moz-keyframes move-twink-back { 65 from {background-position:0 0;} 66 to {background-position:1000px 5000px;} 67 }

View Code

 

学无止境,乐在其中

css参考手册:

属性借鉴来源:     

 

 

1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。

相关文章
  • css3 text-shadow字体阴影讲解 - danran68

    css3 text-shadow字体阴影讲解 - danran68

    2016-10-25 15:00

  • 3d转换-正方体-Html5Css3-遁地龙卷风 - 遁地龙卷风

    3d转换-正方体-Html5Css3-遁地龙卷风 - 遁地龙卷风

    2016-10-25 11:00

  • css3 3d效果及动画学习 - 禾女小姐

    css3 3d效果及动画学习 - 禾女小姐

    2016-10-16 16:00

  • css3径向渐变详解-遁地龙卷风 - 遁地龙卷风

    css3径向渐变详解-遁地龙卷风 - 遁地龙卷风

    2016-10-15 13:13

网友点评
-