方法一
.line {
height: 0.5px;
background-color: gray;
}
优点:设置简单,ios上实用
缺点:安卓不兼容
方法二
.line {
height: 1px;
background-color: gray;
transform: scaleY(0.5);
}
优点:设置简单,兼容ios和安卓
缺点:安卓上效果粗糙
方法三
/* 线条 */
.line {
height: 0;
border-botton: 1px solid gray;
transform: scaleY(0.5);
}
/* 盒子 */
.box {
position: relative;
width: 300px;
height: 200px;
border-radius: 4px;
}
.box::after {
content: '';
position: absolute;
left: 0;
top: 0;
width: 200%;
height: 200%;
border: 1px solid #aaa;
border-radius: 8px;
transform-origin: 0 0;
transform: scale(.5);
pointer-events: none;
}
优点:兼容ios和安卓,效果细腻
缺点:代码较多

8058

被折叠的 条评论
为什么被折叠?



