0

效果展示:

图片发自简书App

代码展示

```

  html, body {

  margin: 0;

  padding:0;

  height: 100%

}

.sky {

  height: 480px;

  background: #007fd5;

  position: relative;

  overflow: hidden;

  -webkit-animation: sky_background 50s ease-out infinite;

  -moz-animation: sky_background 50s ease-out infinite;

  -o-animation: sky_background 50s ease-out infinite;

  animation: sky_background 50s ease-out infinite;

  -webkit-transform: translate3d(0, 0, 0);

  -ms-transform: translate3d(0, 0, 0);

  -o-transform: translate3d(0, 0, 0);

  transform: translate3d(0, 0, 0);

}

.sky .clouds_one {

  background: url("../images/cloud_one.png");

  position: absolute;

  left: 0;

  top: 0;

  height: 100%;

  width: 300%;

  -webkit-animation: cloud_one 50s linear infinite;

  -moz-animation: cloud_one 50s linear infinite;

  -o-animation: cloud_one 50s linear infinite;

  animation: cloud_one 50s linear infinite;

  -webkit-transform: translate3d(0, 0, 0);

  -ms-transform: translate3d(0, 0, 0);

  -o-transform: translate3d(0, 0, 0);

  transform: translate3d(0, 0, 0);

}

.sky .clouds_two {

  background: url("../images/cloud_two.png");

  position: absolute;

  left: 0;

  top: 0;

  height: 100%;

  width: 300%;

  -webkit-animation: cloud_two 75s linear infinite;

  -moz-animation: cloud_two 75s linear infinite;

  -o-animation: cloud_two 75s linear infinite;

  animation: cloud_two 75s linear infinite;

  -webkit-transform: translate3d(0, 0, 0);

  -ms-transform: translate3d(0, 0, 0);

  -o-transform: translate3d(0, 0, 0);

  transform: translate3d(0, 0, 0);

}

.sky .clouds_three {

  background: url("../images/cloud_three.png");

  position: absolute;

  left: 0;

  top: 0;

  height: 100%;

  width: 300%;

  -webkit-animation: cloud_three 100s linear infinite;

  -moz-animation: cloud_three 100s linear infinite;

  -o-animation: cloud_three 100s linear infinite;

  animation: cloud_three 100s linear infinite;

  -webkit-transform: translate3d(0, 0, 0);

  -ms-transform: translate3d(0, 0, 0);

  -o-transform: translate3d(0, 0, 0);

  transform: translate3d(0, 0, 0);

}

@-webkit-keyframes sky_background {

  0% {

background: #007fd5;

color: #007fd5

  }

  50% {

background: #000;

color: #a3d9ff

  }

  100% {

background: #007fd5;

color: #007fd5

  }

}

@-moz-keyframes sky_background {

  0% {

background: #007fd5;

color: #007fd5

  }

  50% {

background: #000;

color: #a3d9ff

  }

  100% {

background: #007fd5;

color: #007fd5

  }

}

@keyframes sky_background {

  0% {

background: #007fd5;

color: #007fd5

  }

  50% {

background: #000;

color: #a3d9ff

  }

  100% {

background: #007fd5;

color: #007fd5

  }

}

@-webkit-keyframes cloud_one {

  0% {

left: 0

  }

  100% {

left: -200%

  }

}

@-moz-keyframes cloud_one {

  0% {

left: 0

  }

  100% {

left: -200%

  }

}

@keyframes cloud_one {

  0% {

left: 0

  }

  100% {

left: -200%

  }

}

@-webkit-keyframes cloud_two {

  0% {

left: 0

  }

  100% {

left: -200%

  }

}

@-moz-keyframes cloud_two {

  0% {

left: 0

  }

  100% {

left: -200%

  }

}

@keyframes cloud_two {

  0% {

left: 0

  }

  100% {

left: -200%

  }

}

@-webkit-keyframes cloud_three {

  0% {

left: 0

  }

  100% {

left: -200%

  }

}

@-moz-keyframes cloud_three {

  0% {

left: 0

  }

  100% {

left: -200%

  }

}

@keyframes cloud_three {

  0% {

left: 0

  }

  100% {

left: -200%

  }

}

```



图片发自简书App

图片发自简书App

图片发自简书App

图片发自简书App

图片发自简书App

图片发自简书App

图片发自简书App

图片发自简书App

图片发自简书App

图片发自简书App

图片发自简书App

图片发自简书App

图片发自简书App
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 选择qi:是表达式 标签选择器 类选择器 属性选择器 继承属性: color,font,text-align,li...
    love2013阅读 2,339评论 0 11
  • # 移动端开发 ### 1. 1px问题如何解决 #### ①伪类 + transform(比较完美) > 原理是...
    sunnyRube阅读 908评论 0 0
  • 背景 背景大小控制(注意:大小要写在背景属性后面) background-size:auto;/* 默认值,不改变...
    色即是猫阅读 382评论 0 0
  • "use strict";function _classCallCheck(e,t){if(!(e instanc...
    久些阅读 2,054评论 0 2
  • 久违了啊,文字。 某一天,当微信里有个朋友告诉我,自从我没了文字的记录,走心这件事似乎就离我越来越远了。原来,当初...
    轩妈爱生活阅读 331评论 0 0