我正在尝试使用border: 10px double red;
添加双边框,但是如何控制边框的粗细和间距?我希望边框的厚度为1px。如果我只是将边框更改为1px,则边框会重叠并且几乎只能看到一个边框。我还尝试了1px的边框宽度,但结果相同。
我也一直在尝试使用边框间距属性,但无法使其正常工作。
以下是我要完成的操作的屏幕截图:https://share.getcloudapp.com/JrugmEG2
工作中的jsfiddle:https://jsfiddle.net/7Lw21z85/
HTML:
<div class="container">
<span class="box">
<h1 class="heading">
Heading text
</h1>
<p>
some text :)
</p>
</span>
</div>
CSS:
.container {
text-align: center;
display: flex;
align-items: center;
flex-direction: column;
padding: 8%;
background-color: black;
}
.heading {
margin: 0;
padding: 0;
color: black;
}
p {
margin: 0;
padding: 0;
color: black;
}
.box {
background-color: white;
border: 10px double red;
padding: 8%;
outline: 15px solid #ffffff;
}