如何确保子元素不遮盖嵌入阴影? [英] How do I make sure child elements do not cover up inset shadow?
本文介绍了如何确保子元素不遮盖嵌入阴影?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个 div
元素与一些子元素,我想尝试应用一个插入盒子阴影子元素似乎覆盖了盒子阴影,这里是一个jfiddle示例:
jsFiddle演示
I have a div
element with some child elements, and I'm trying to apply a inset box-shadow the child elements seem to be covering up the box-shadow, here is a jfiddle example:
jsFiddle Demo
如果你拿走 optn
类的 background-color
看到插入框阴影,因此我的代码 有效。所以问题是,如何使子元素出现在box-shadow下?
If you take away the background-color
on the optn
class you'll see the inset box shadow there, so my code is valid. So the questions is, how do I make it so the child elements appear under the box-shadow?
推荐答案
将背景颜色移到父级。
这篇关于如何确保子元素不遮盖嵌入阴影?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文