<div class="inset-border">文字内容</div>
body {
background: darkcyan;
padding: 30px;
}
.inset-border {
padding: 40px;
color: #fff;
background: linear-gradient(darkred, darkred) no-repeat center / calc(100% - 30px) 100%,
linear-gradient(darkred, darkred) no-repeat center / 100% calc(100% - 30px);
filter: drop-shadow(0 4px) drop-shadow(4px 0) drop-shadow(0 -4px) drop-shadow(-4px 0);
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.