div+css布局实现逼真水滴效果代码
代码语言:html
所属分类:布局界面
代码描述: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); border-radius: 64% 36% 42% 58% / 42% 37% 63% 58%; } .drop:nth-child(3){ transform: scale(0.5) translate(280px, 10px); border-radius: 49% 51% 42% 58% / 56% 47% 53% 44%; } .drop:nth-child(4){ transform: scale(0.35) translate(120px, -350px); border-radius: 58% 42% 72% 28% / 65% 44% 56% 35% ; } .drop:nth-child(5){ transform: scale(0.60) translate(-180px, -180px); border-radius: 45% 55% 35% 65% / 54% 68% 32% 46% } .drop:nth-child(6){ transform: scale(0.15) translate(-950px, -1330px); border-radius: 42% 58% 70% 30% / 46% 49% 51% 54%; } .drop:nth-child(7){ transform: scale(0.12) translate(-1200px, -350px); border-radius: 42% 58% 32% 68% / 63% 49% 51% 37%; } .drop:.........完整代码请登录后点击上方下载按钮下载查看
网友评论0