纯css html 真实水滴效果

惯例,不多说直接上图

遵循开源精神,源码就直接放下面了,

html 复制代码
<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8" />
  <title>whater</title>
  <style>
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    body {
      display: flex;
      justify-content: center;
      align-items: center;
      min-height: 100vh;
      background: #edeeed;
    }

    body>div {
      position: relative;
      display: flex;
      justify-content: center;
      align-items: center;
    }

    body>div>div {
      position: absolute;
      width: 150px;
      height: 150px;
      background: transparent;
      border-radius: 57% 43% 37% 63% / 45% 52% 48% 55%;
      box-shadow: inset 10px 10px 10px rgba(0, 0, 0, 0.05),
        15px 25px 10px rgba(0, 0, 0, 0.1), 15px 20px 20px rgba(0, 0, 0, 0.05),
        inset -10px -10px 15px rgba(255, 255, 255, 0.9);
    }

    body>div>div::before {
      content: "";
      position: absolute;
      top: 25px;
      left: 35px;
      background: #fff;
      width: 20px;
      height: 20px;
      border-radius: 42% 58% 37% 63% / 40% 43% 57% 60%;
    }

    body>div>div::after {
      content: "";
      position: absolute;
      top: 25px;
      left: 65px;
      background: #fff;
      width: 10px;
      height: 10px;
      border-radius: 57% 43% 37% 63% / 48% 37% 63% 52%;
    }

    body>div>div:nth-child(2) {
      transform: scale(0.5) translate(-200px, 180px);
      border-radius: 64% 36% 42% 58% / 42% 37% 63% 58%;
    }

    body>div>div:nth-child(3) {
      transform: scale(0.5) translate(280px, 10px);
      border-radius: 49% 51% 42% 58% / 56% 47% 53% 44%;
    }

    body>div>div:nth-child(4) {
      transform: scale(0.5) translate(120px, -350px);
      border-radius: 39% 61% 63% 37% / 77% 47% 53% 23%;
    }

    body>div>div:nth-child(5) {
      transform: scale(0.3) translate(20px, -350px);
      border-radius: 37% 63% 64% 36% / 53% 65% 35% 47%;
    }

    body>div>div:nth-child(6) {
      transform: scale(0.7) translate(-150px, -200px);
      border-radius: 37% 63% 64% 36% / 53% 65% 35% 47%;
    }

    body>div>div:nth-child(7) {
      transform: scale(0.4) translate(-400px, -100px);
      border-radius: 37% 63% 64% 36% / 53% 65% 35% 47%;
    }
  </style>
</head>

<body>
  <div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
  </div>
</body>

</html>
相关推荐
ma774 分钟前
JavaScript 获取短链接原始地址的解决方案
前端
该用户已不存在4 分钟前
关于我把Mac Mini托管到机房,后续来了,还有更多玩法
服务器·前端·mac
tianchang7 分钟前
SSR 深度解析:从原理到实践的完整指南
前端·vue.js·设计模式
闲蛋小超人笑嘻嘻9 分钟前
前端面试十一之TS
前端
摆烂为不摆烂9 分钟前
😁深入JS(四): 一文让你完全了解Iterator+Generator 实现async await
前端
DoraBigHead21 分钟前
🧠 别急着传!大文件上传里,藏着 Promise 的高级用法
前端·javascript·面试
嘉琪00124 分钟前
封装一个有最小化的dialog组件
前端·javascript·css
水果里面有苹果27 分钟前
20-C#构造函数--虚方法
java·前端·c#
Zachery Pole27 分钟前
BootStrap
前端·bootstrap·html
一尾流莺29 分钟前
【2025 年中总结】世事浮云何足问,不如高卧且加餐
前端·掘金社区