【发布时间】:2018-02-28 16:47:27
【问题描述】:
我们网站上有多个地方使用 .svg 和背景图像规则来创建形状。
例如:
&:before {
bottom: auto;
height: 4rem;
content:'';
display: block;
width: 100%;
position: absolute;
left: 0;
top: 0;
background-image: url('img/layout/press-before.svg');
background-size: 100%;
background-repeat: no-repeat;
@media screen and (max-width: $viewport-xs) {
height: 2rem;
}
@media screen and (max-width: $viewport-sm) {
top: -.1rem;
}
}
这适用于所有分辨率的桌面。 但是在使用 chrome 的几个移动设备上,当 adjected 块具有相同的颜色时会出现问题。 似乎有 1 个或多个像素被错误地插值,从而导致显示底层元素的边缘。
我尝试过的事情: + 使用 png、jpg 而不是 .svg 来查看问题是否与 .svg 的光栅化有关(问题仍然存在,没有区别) + 将图像略微向上移动(保留线条) + 使其稍大(保留线)
有关参考,请参阅以下图片。
issue example 1 issue example 2
非常感谢任何建议!
【问题讨论】:
标签: css google-chrome mobile background-image styling