I have a bit of a problem with creating a block with beveled edges, in addition I need a border to be beveled and slightly off the main block. The problem is that this block can be Reponsive according to the screen.
I do not know the exact way to do it, hope everyone helps.
This is what I do now
.box {
display: flex;
padding: 20px;
height: 200px;
width: 300px;
color: #ffffff;
background: red;
position: relative;
}
.box .edge {
width: 18px;
height: 10px;
background: #ffffff;
position: absolute;
}
.box .edge.top-left {
top: -4px;
left: -8px;
transform: rotate(-45deg);
}
.box .edge.top-right {
top: -4px;
right: -8px;
transform: rotate(45deg);
}
.box .edge.bottom-left {
bottom: -4px;
left: -8px;
transform: rotate(45deg);
}
.box .edge.bottom-right {
bottom: -4px;
right: -8px;
transform: rotate(-45deg);
}
<div class="box">
<div class="edge top-left"></div>
<div class="edge top-right"></div>
<div class="edge bottom-left"></div>
<div class="edge bottom-right"></div>
<div class="content">
content
</div>
</div>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…