🗒️box-shadow

box-shadow 属性为元素添加 shadow 效果,一次可设置多个。border-radius 对其有效。

box-shadow: <outset|inset> <offset-x> <offset-y> <blur-radius> <spread-radius> <color>
  • 可以指定多个 shadows,用 , 分隔,它们的 z-order 是最先指定的在上面

  • outset 在盒子外部,层级是在元素的 background 下方

  • inset 在盒子内部,层级是在元素的 background 上方、content 下方

效果举例:

Last updated