I found this image online and tryed to create these boxes with css. I failed. Has anyone an idea how to solve this problem?
This is my code. The problem is the left bar:
.box {
position: relative;
margin: 10px;
display: inline-block;
}
.content {
border-top: 2px solid red;
border-right: 2px solid red;
padding: 5px;
}
.box:before {
content: '';
position: absolute;
top: 0;
left: -10px;
height: 100%;
width: 10px;
background-color: red;
transform: skew(-45deg) rotate(-45deg);
}
.box:after {
content: '';
position: absolute;
bottom: -10px;
left: -5px;
height: 10px;
width: 100%;
background-color: red;
transform: skew(-45deg);
}
<div class="box">
<div class="content">
CONTENT<br />
Some more content
</div>
</div>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…