我希望实现以下图片中的三重边框。
我尝试了下面的解决方法,但是角落看起来仍然不同。它们没有重叠。
看这个: https://jsfiddle.net/kajh1odv/1/
.dtborder {
position: relative;
border: 5px solid red;
height: 500px;
width: 500px;
background: #f8f8f8;
padding: 30px;
}
.dtborder:before {
content: "";
position: absolute;
top: 5px;
bottom: 5px;
left: 5px;
right: 5px;
border: 5px solid blue;
}
.dtborder:after {
content: "";
position: absolute;
top: 15px;
bottom: 15px;
left: 15px;
right: 15px;
border: 5px solid green;
}
<div class="dtborder ">This text appears inside a double bracket bordered div where you can control the gap between border lines.</div>
border-image
..可能更容易。 - Paulie_D