用一个铺满蓝色的背景的盒子,
利用::before与after画2个圆角值不同的不规则圆形(其中一个设置透明度或者其他颜色,以便区分):
父元素设置overflow:hidden;
最后加上animation 动画让不同规则圆形旋转起来即可:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<div class="wave"></div>
</body>
<style>
/* // 简单的盒子 */
.wave {
position: relative
width: 150px
height: 150px
background-color: #5291e0
/* overflow: hidden*/
}
/* // 两个不规则圆形(相对盒子进行定位,距离底部距离则为波浪高度) */
.wave::before,
.wave::after {
content: ""
position: absolute
left: 50%
bottom: 15%
width: 500%
height: 500%
border-radius: 45%
background-color: #fff
transform: translateX(-50%)
animation: rotate 15s linear infinite
}
/* // 其中一个不规则圆形调整一下样式,以便区分(或者调整animation的参数来区分) */
.wave::before {
bottom: 10%
opacity: .5
border-radius: 47%
}
/* // 旋转动画 */
@keyframes rotate {
from {
transform: translateX(-50%) rotateZ(0deg)
}
to {
transform: translateX(-50%) rotateZ(360deg)
}
}
</style>
</html>
div{background:
radial-gradient(circle at 100% 50%, transparent 20%, rgba(255,255,255,.3) 21%, rgba(255,255,255,.3) 34%, transparent 35%, transparent),
radial-gradient(circle at 0% 50%, transparent 20%, rgba(255,255,255,.3) 21%, rgba(255,255,255,.3) 34%, transparent 35%, transparent) 0 -50px
background-color: slategray
background-size:75px 100px
}
更多背景底纹私聊我给你网址,有好多