老样子,先上效果图
一、HTML
<div class="container">
<div class="cloud">
</div>
</div>
二、CSS
/* 常规初始化 */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
/* 水平垂直居中 */
display: flex;
justify-content: center;
align-items: center;
width: 100vw;
height: 100vh;
background-color: #d3f1f1;
}
/* 云朵 */
.cloud {
position: relative;
width: 400px;
height: 110px;
background-color: #fff;
border-radius: 50px;
}
/* 使用伪元素加盒子阴影在云朵上面加两个圆 */
.cloud::before {
position: absolute;
top: -65%;
left: 38%;
content: '';
width: 180px;
height: 180px;
border-radius: 50%;
background-color: #fff;
/* 盒