1、问题描述
如何在移动端实现border:1px的功能。
2、自己的思考
如果只是border-top, border-bottom, border-left, bottom-right。我一般会用以下代码:
@mixin setTopLine($color: #C7C7C7) {
content: " ";
position: absolute;
left: 0;
top: 0;
right: 0;
height: 1px;
border-top: 1px solid $color;
color: $color;
-webkit-transform-origin: 0 0;
transform-origin: 0 0;
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
}
但是如果想四条边同时设为1px
,那应该如何写呢?
用:after或者:before