css实现90多款盒子阴影效果代码
代码语言:html
所属分类:布局界面
代码描述:css实现90多款盒子阴影效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> @import url("https://fonts.googleapis.com/css2?family=Exo:wght@600&display=swap"); * { margin: 0; padding: 0; box-sizing: border-box; } body { width: 100vw; min-height: 100vh; font-family: "Exo", Arial, sans-serif; background-color: #fff; color: #fff; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); gap: 30px; padding: 30px; counter-reset: item; } .box { background-color: #fff; border-radius: 6px; min-height: 160px; --shadow: 1px 1px 1px 1px rgb(0 0 0 / 0.25); box-shadow: var(--shadow); counter-increment: item; display: flex; justify-content: center; align-items: center; } .box::before { content: counter(item); display: block; -webkit-background-clip: text; color: transparent; background-image: linear-gradient(115deg, #fc00ff, #00dbde); font-weight: 700; font-size: clamp(1.2rem, 2rem + 2vw, 3rem); } </style> </head> <body> <div class="box" style="--shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;"></div> <div class="box" style="--shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;"></div> <div class="box" style="--shadow: rgba(0, 0, 0, 0.15) 1.95px 1.95px 2.6px;"></div> <div class="box" style="--shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;"></div> <div class="box" style="--shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;"></div> <div class="box" style="--shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;"></div> <div class="box" style="--shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;"></div> <div class="box" style="--shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px, rgb(51, 51, 51) 0px 0px 0px 3px;"></div> <div class="box" style="--shadow: rgba(0, 0, 0, 0.02) 0px 1px 3px 0px, rgba(27, 31, 35, 0.15) 0px 0px 0px 1px;"></div> <div class="box" style="--shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;"></div&g.........完整代码请登录后点击上方下载按钮下载查看
网友评论0