首页 > 代码库 > css浮动的白云
css浮动的白云
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<style>
.box{
position: relative;
height: 300px;
width: 500px;
}
.s1,.s2{
position: absolute;
height: 100%;
width: 100%;
background-size:cover;
animation: move 100s infinite linear alternate;
}
@keyframes move{
100%{background-position: 500% 0;}
}
.s1{
background-image: url(‘http://sandbox.runjs.cn/uploads/rs/26/ddzmgynp/cloud.png‘);
}
.s2{
background-image: url(‘http://sandbox.runjs.cn/uploads/rs/26/ddzmgynp/cloud1.png‘);
animation-duration: 10s;
}
</style>
</head>
<body>
<div class="box">
<div class="s1"></div>
<div class="s2"></div>
</div>
</body>
</html>
css浮动的白云