在伪元素的顶部显示阴影

问题描述

我正在尝试实现以下效果:

Box with shadow and a colourful banner

我的代码如下:

.box {
  background: #fff;
  width: 600px;
  height: 100px;
  position: relative;
  z-index: 999;
  box-shadow: 0px 2px 4px 0px rgba(0,0.75);
}

.box::after {
  background: linear-gradient(to right,#00a1e4 25%,#ff9a00 25%,#ff9a00 50%,#00a525 50%,#00a525 75%,#8c449d 75%);
  position: absolute;
  content: "";
  height: 10px;
  right: 0;
  left: 0;
  bottom: -10px;
  z-index: 1;
}
<div class="box">
</div>

在上面的示例中,伪元素出现在框阴影的顶部, 如何使阴影显示在伪元素的顶部?

Here is the example on codepen

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)