云朵的运动
<!DOCTYPE html> <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> <!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]--> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>青青草原</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="./style.css"> </head> <body> <!--[if lt IE 7]> <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="#">upgrade your browser</a> to improve your experience.</p> <![endif]--> <!-- 天空 --> <div class="sky"> <!-- 五朵云 --> <!-- 第一朵云 --> <div class="cloud center"> <div class="one center"></div> <div class="two"></div> <div class="three"></div> <div class="shade center"></div> </div> <!-- 第二朵云 --> <div class="cloud"> <div class="one center"></div> <div class="two"></div> <div class="three"></div> <div class="shade center"></div> </div> <!-- 第三朵云 --> <div class="cloud"> <div class="one center"></div> <div class="two"></div> <div class="three"></div> <div class="shade center"></div> </div> </div> <!-- 草地 --> <div class="grassland"></div> <!-- <script src="" async defer></script> --> </body> </html>
* {
margin: 0;
padding: 0;
border: 0;
}
body {
height: 100vh;
overflow: hidden;
}
.center {
position: absolute;
left: 50%;
transform: translate(-50%, 0);
}
/* 天空 */
.sky {
height: 60%;
width: 100%;
background: linear-gradient(180deg, rgb(196, 228, 253) 0%, rgb(196, 228, 253) 40%,
#fff 100%);
}
.sky .cloud {
width: 600px;
height: 400px;
transform: scale(.5);
}
/* 云的第一块组成部分 */
.sky .cloud .one {
width: 380px;
height: 100px;
position: absolute;
bottom: 29px;
border-radius: 50px / 50px;
background: #fff;
z-index: 1;
}
/* 云的第二块组成部分 */
.sky .cloud .two {
width: 170px;
height: 100px;
position: absolute;
left: 130px;
bottom: 40px;
border-radius: 50px / 50px;
background: #fff;
transform: rotate(56deg);
z-index: 2;
}
/* 云的第三块组成部分 */
.sky .cloud .three {
width: 230px;
height: 230px;
position: absolute;
left: 101px;
bottom: 50px;
border-radius: 50%;
background: #fff;
transform: translate(136px, 34px);
z-index: 3;
}
/* 云的遮罩 */
/* .sky .cloud .shade {
width: 450px;
height: 100px;
position: absolute;
bottom: 30px;
border-radius: 50px / 50px;
background: #fff;
z-index: 4;
} */
/* 第一朵云 */
.sky > div:nth-of-type(1) {
animation: one 10s infinite linear;
}
@keyframes one {
0% {
left: 100%;
}
100% {
left: 0%;
}
}
/* 第二朵云 */
.sky > div:nth-of-type(2) {
position: absolute;
top: 120px;
right: 100px;
animation: one 14s infinite linear;
}
/* 第三朵云 */
.sky > div:nth-of-type(3) {
position: absolute;
top: -120px;
right: -100px;
animation: one 15s infinite linear;
}
/* 草地 */
.grassland {
height: 40%;
width: 100%;
background: linear-gradient(180deg, #fff 0%, rgb(148, 190, 89) 60%, rgb(148, 190, 89) 100%);
}这个云朵运动到距左边一点就回去了,但没到边缘啊
1
收起
正在回答 回答被采纳积分+1
1回答



恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星