前言

在一个菜单面板的时候,把间隔线设置成了 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 1px 间隔线在 Safari 显示颜色不同于其它的问题

解决

细找问题,找出来了,我在 ::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);

完成

::after 1px 间隔线在 Safari 显示颜色不同于其它的问题


对比

::after 1px 间隔线在 Safari 显示颜色不同于其它的问题


::after 1px 间隔线在 Safari 显示颜色不同于其它的问题

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-13
  • 2022-12-23
  • 2021-04-11
  • 2022-12-23
  • 2022-01-26
  • 2022-12-23
猜你喜欢
  • 2022-01-13
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案