div+css布局实现逼真水滴效果代码

代码语言:html

所属分类:布局界面

代码描述:div+css布局实现逼真水滴效果代码

代码标签: div css 布局 逼真 水滴

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!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">
<style>
    *{
    margin: 0;
    padding: 0;
}

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

.drops{
    
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: scale(3);
}

.drop{
    
    position: absolute;
    top: 40%;
    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);
}

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

.drop::after{
    
    content: '';
    position: absolute;
    top: 25px;
    left: 65px;
    background: #fff;
    width: 10px;
    height: 10px;
    border-radius: 57% 43% 37% 63% / 40% 43% 63% 52%;
    
}

.drop:nth-child(2){
    
    transform: scale(0.5) translate(-200px, 280px).........完整代码请登录后点击上方下载按钮下载查看

网友评论0