使用css3缩放来解决,注意这种情况下,尺寸都要是原来的二倍
场景1:下边框
.box_item{
position: relative;
}
&:after{
content: "";
display: block;
position: absolute;
left: -50%; bottom: 0;
width: 200%;
height: 1px;
background:rgba(0, 0, 0, 0.1);
transform:scale(0.5);
-webkit-transform:scale(0.5);
}
场景2:按钮全边框
.btn {
position: relative;
}
.btn_border{
position: absolute;
width: 200%;
height: 200%;
left: -50%; top: -50%;
border: 1px solid #ccc;
border-radius: 4px;
transform: scale(0.5);
-webkit-transform: scale(0.5);
box-sizing: border-box;
}