CSS框阴影 - 顶部和底部 [英] CSS Box Shadow - Top and Bottom Only
问题描述
如何做到这一点,但是如何添加一个框阴影只在元素的顶部和底部?
I cannot find any examples of how to do this, but how can I add a box shadow only to the top and bottom of an element?
推荐答案
克里斯蒂安已经指出,对z值的良好控制通常会解决你的问题。
As Kristian has pointed out, good control over z-values will often solve your problems.
如果这不起作用,你可以看看 CSS Box Shadow Bottom Only 使用溢出隐藏以隐藏多余的阴影。
If that does not work you can take a look at CSS Box Shadow Bottom Only on using overflow hidden to hide excess shadow.
我也想到box-shadow属性可以接受以逗号分隔的阴影列表,例如:
I would also have in mind that the box-shadow property can accept a comma-separated list of shadows like this:
box-shadow: 0px 10px 5px #888, 0px -10px 5px #888;
这样可以控制每个方向上的阴影量。
This will give you some control over the "amount" of shadow in each direction.
请查看 http://www.css3。
Have a look at http://www.css3.info/preview/box-shadow/ for more information about box-shadow.
希望这是您正在寻找的!
Hope this was what you were looking for!
这篇关于CSS框阴影 - 顶部和底部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!