.weui_actionsheet_cell {
position: relative;
padding: 10px 0;
text-align: center;
font-size: 18px;
}
.weui_actionsheet_cell:before {
content: " ";
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 1px;
border-top: 1px solid #D9D9D9;
color: #D9D9D9;
-webkit-transform-origin: 0 0;
transform-origin: 0 0;
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
}
我想知道为什么weui中,利用伪元素生成border,同时使用了border:1px和height:1px;,然后又在Y轴上缩放0.5倍。我觉得直接用border不久可以了,应该没有那个浏览器不支持border的吧。
伊谢尔伦2017-04-17 11:46:02
In order to adapt to the 1px border problem of high-definition screens and retina screens. Use transform scale y to solve it in one go. The advantage of using pseudo-elements is that there are no more useless p tags.
阿神2017-04-17 11:46:02
If there is only width but no height, the height should be given here just for better display~to avoid the situation that it cannot be displayed~~This should be for the border width of 1px, first give the height of 1px, and then give Scale the Y axis back ~ it should be a line in the end.