如何在此对象的右侧添加边框以完成具有与左侧边框相同属性的正方形。添加框阴影:20px 0 0 0 红色;不起作用,但会覆盖左边框。
https://jsfiddle.net/kheuz1z4/
HTML
CSS
#borders {
border-top: 20px solid black;
box-shadow: -20px 0 0 0 red;
border-bottom: 20px solid green;
height: 150px;
margin: 30px;
width: 150px;
border-radius: 20px 20px 0px 0px;
}
最佳答案
你可以用逗号分隔 box-shadow:
#borders {
border-top: 20px solid black;
box-shadow: -20px 0 0 0 red, 20px 0 0 0 red;
border-bottom: 20px solid green;
height: 150px;
margin: 30px;
width: 150px;
border-radius: 20px 20px 0px 0px;
}
来源:Is there a way to use two CSS3 box shadows on one element?
关于css - 如何在此对象的右侧添加边框?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40195581/