css - SVG 图像 Sprite 作为背景图像缩放在 Chrome 53 上崩溃

标签 css svg background-image zooming

我在使用 svg 图像 sprite 作为背景图像时遇到问题。在 100% 缩放时一切正常,但当我放大或缩小时,背景图像会崩溃。 另请注意,它仅在设置 border radius 属性时才起作用,它适用于 Chrome 52 版,但不适用于最新的 53 版。 我创建了一个演示:https://jsfiddle.net/t3m9gpeL

.icon {
    display: inline-block;
    width: 32px;
    height: 32px;
    background: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/fragment-ready-2.svg") no-repeat;
}
.icon-clock {
    background-size: 32px 96px;
    background-position: 0 0;
}
.icon-heart {
    background-size: 32px 96px;
    background-position: 0 -32px;
}
.icon-arrow-right {
    background-size: 32px 96px;
    background-position: 0 -64px;
}
.block-with-border .icon {
    border: 1px solid red;
}
.block-with-border-radius .icon {
    border-radius: 5px;
}
.block-with-border-and-border-radius .icon {
    border-radius: 5px;
    border: 1px solid red;
}

1) 是 Chrome 53 错误吗? 2) 如何避免这种行为?

最佳答案

这似乎是 Chrome 的一个错误。我有同样的问题。

Chrome issue

关于css - SVG 图像 Sprite 作为背景图像缩放在 Chrome 53 上崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39857625/

相关文章:

javascript - 为什么我不能在我的网页上滚动?

jquery - 切换菜单 onclick,通过单击菜单链接关闭 - 但仅在移动 View 中

javascript - 中心点的 Svg 缩放路径(脉动)

javascript - 显示 : flex and svg 的奇怪鼠标事件

javascript - 想要通过浏览器使静态 SVG 绘图(来自 matplotlib)具有交互性

php - 列出网页上使用的所有背景图像的最佳方式是什么?

css - 为什么我的 em 边距计算不正确?

jquery - 网页上聊天机器人的动态高度和宽度

jQuery 以随机间隔将背景图像更改为多个 div

html - 使用 Bootstrap 在移动设备上调整背景图像大小的问题