css实现水波纹
效果预览
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/d84bcaf614059f9b104561e0f6f8a2d4.png)
代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.content {
width: 100px;
height: 300px;
box-shadow: 0px 5px 10px 0px rgb(177, 174, 174);
background-color: #dfbf94;
/* background-image: #dfbf94; */
overflow: hidden;
position: relative;
}
.content p {
color: #dfbf94;
font-size: 30px;
text-align: center;
line-height: 150px;
position: relative;
z-index: 99999;
font-weight: bold;
font-family: serif;
}
.wave {
position: absolute;
width: 550px;
height: 550px;
top: -350px; /*修改这里调整水位*/
left: -200px;
background-color: #dfcbb4;
border-radius: 38%;
animation: drift 5s linear infinite;
}
.wave:nth-of-type(1) {
animation-duration: 5s;
}
.wave:nth-of-type(2) {
background-color: #dfd9d4;
animation-duration: 7s;
}
@keyframes drift {
from {
transform: rotate(360deg);
}
}
</style>
</head>
<body>
<div class="content">
<p>43</p>
<span class="wave"></span>
<span class="wave"></span>
</div>
</body>
</html>