console
<html>
<head></head>
<body>
<div class="border">1条边框</div>
<div class="border1">4条边框</div>
</body>
</html>
.border {
width: 300px;
height: 200px;
position: relative;
}
.border::after {
position: absolute;
content: '';
background-color: red;
width: 100%;
height: 1px;
transform: scale(1, 0.5);
top: 0;
left: 0;
}
.border1 {
width: 300px;
height: 200px;
text-align: center;
line-height: 200px;
position: relative;
}
.border1::after {
content: '';
position: absolute;
left: 0;
top: 0;
width: 200%;
height: 200%;
border: 1px solid red;
transform: scale(0.5);
transform-origin: left top;
border-radius: 20px;
}