🎭 CSS Box Shadow Generator
Adjust offset, blur, spread and colour to produce CSS box-shadow code, with multiple layers for layered depth.
📐 计算公式 / 原理
层参数组装:box-shadow = [inset] Xpx Ypx 模糊px 扩散px rgba(R, G, B, 透明度%);勾选 inset 为内阴影、省略为外阴影;多个图层以逗号分隔自上而下叠加
按 offset-x / offset-y / blur / spread / color 拼装 box-shadow 声明,支持多层叠加与 inset 内阴影,实时预览并复制;用于元素立体感与层次设计。
📚 深度解析:阴影生成器
💡 常见使用场景
- 做卡片悬浮阴影。
- 做双层质感阴影。
- 内阴影凹陷效果。
生成柔和投影
❓ 常见问题(FAQ)
- 多层阴影怎么写?
- 用逗号分隔多个 shadow 值即可叠加。结果以浏览器实时计算为准,纯前端本地处理、数据不上传;生成的样式与代码仅作快速产出参考,正式项目请以设计系统、规范与浏览器实测为准。
- 生成的代码/图片能直接用吗?
- 可直接复制使用,建议粘到项目后在浏览器实测微调;本工具只生成不托管。
- 会保存或上传我的内容吗?
- 结果以浏览器实时计算为准,纯前端本地处理、数据不上传;生成的样式与代码仅作快速产出参考,正式项目请以设计系统、规范与浏览器实测为准。
Formula & Standard References
| Item | Formula / Note | Source / Standard |
|---|---|---|
| Parameter order | offset-x, offset-y, blur-radius, spread-radius, colour | CSS Backgrounds and Borders Level 3 |
| Inset shadows | the inset keyword paints the shadow inside the border box | CSS Backgrounds and Borders Level 3 |
| Stacked shadows | earlier shadows in a comma list paint on top and clip later ones | CSS Backgrounds and Borders Level 3 |
⚠️ 使用说明与注意事项
- 本工具纯前端运行,数据不会上传到服务器
- 建议在主流浏览器(Chrome/Safari/Firefox/Edge)中使用
- 计算结果仅供参考,请以实际应用场景为准