移动端0.5像素细线

方法一

.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和安卓,效果细腻
缺点:代码较多

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值