::after 1px 间隔线在 Safari 显示颜色不同于其它的问题
前言
在一个菜单面板的时候,把间隔线设置成了 1 绝对像素,生成的效果是下面这样的,在一个线跟其它的不一样。但在 Chrome 上就不会出现这问题。
width: 100%;
bottom: 0;
left: 0;
content: '';
display: block;
border-bottom: 1px solid #8E8E93;
position: absolute;
transform-origin: 0 100%;
transform: scaleY(0.5);解决
细找问题,找出来了,我在 ::after 内写的是 border-bottom ,也就是说,在纵向压缩的时候,压缩的是 border。 换成用 background-color ,也就是用 after 的主体。
width: 100%;
bottom: 0;
left: 0;
content: '';
display: block;
background-color: #8E8E93;
height: 1px;
position: absolute;
transform-origin: 0 100%;
transform: scaleY(0.5);完成
本文内容仅供个人学习/研究/参考使用,不构成任何决策建议或专业指导。分享/转载时请标明原文来源,同时请勿将内容用于商业售卖、虚假宣传等非学习用途哦~感谢您的理解与支持!