首页 > Web开发 > 详细

css3动画(animation)效果1-漂浮的白云

时间:2018-03-01 19:29:53      阅读:218      评论:0      收藏:0      [点我收藏+]
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>漂浮的白云</title>
    <style type="text/css">
        .box {
            position: relative;
            height: 300px;
            width: 500px;
        }

        .in1, .in2 {
            position: absolute;
            height: 100%;
            width: 100%;
            background-size: cover;
            animation: move 100s infinite linear alternate;
        }

        @keyframes move {
            100% {
                background-position: 500% 0;
            }
        }

        .in1 {
            background-image: url(‘http://sandbox.runjs.cn/uploads/rs/26/ddzmgynp/cloud.png‘);
        }

        .in2 {
            background-image: url(‘http://sandbox.runjs.cn/uploads/rs/26/ddzmgynp/cloud1.png‘);
            animation-duration: 10s;
        }
    </style>
</head>
<body>
<h1>漂浮的白云</h1>
<div class="box">
    <div class="in1"></div>
    <div class="in2"></div>
</div>


<strong>【简要介绍】</strong>
  <p>漂浮的白云主要通过远景白云和近景白云来实现立体漂浮效果。远景和近景分别使用两张背景图片,通过改变其背景定位来实现白云移动效果,通过设置不同的动画持续时间来实现交错漂浮的效果</p>
</body>
</html>

效果图:

技术分享图片

 原链接:https://www.cnblogs.com/xiaohuochai/p/5419236.html

css3动画(animation)效果1-漂浮的白云

原文:https://www.cnblogs.com/huanghuali/p/8489479.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!