最佳答案
这就是我使用伪元素的方式,因此您不必再添加 html。
HTML
<div class="box">
</div>
CSS
.box {
width: 300px;
height: 80px;
background: black;
position: relative;
}
.box:after {
content: "";
display: block;
width: 300px;
height: 80px;
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
position: absolute;
top: 10px;
left: 10px;
border: 1px solid black;
}
最后一个 fiddle :Demo
关于html - 在框阴影上应用边框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21173210/