利用transform的scale属性,由1px缩放为0.5px
.box {
width: 50px;
height: 50px;
background-color: #ccc;
position: relative;
}
.box::after {
content: " ";
position: absolute;
left: 0;
top: 0;
z-index:-1;
width: 200%;
height:200%;
border:1px solid red;
transform-origin: -1px -1px;
transform: scale(.5, .5) ;
}