1.scale缩放
.element {
border: 1px solid black;
transform: scale(0.5);
transform-origin: top left;
}
2. 伪元素
// 伪元素的层叠顺序问题,可能会与其他元素的层叠产生冲突
.element {
width: 500px;
height: 500px;
position: relative;
}
.element::after {
content: "";
position: absolute;
top: 0.5px;
left: 0.5px;
right: 0.5px;
bottom: 0.5px;
border: 0.5px solid black;
z-index: -1;
}