【发布时间】:2013-11-18 11:09:29
【问题描述】:
我想使用缩放的 svg 图像作为不同大小的图标,但在 firefox 中发现不一致的行为。
如果没有 css sprite,firefox 会对缩放的图像进行抗锯齿处理。但是对于 css sprite,firefox 不会对它们进行反锯齿处理。因此,使用 css sprite 的图标看起来很难看。
详情请访问jsfiddle。火狐有什么问题?
<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.whole {
width: 80px;
height: 80px;
background-image: url("outliner.svg");
background-size: 100% 100%;
}
i {
width: 16px;
height: 16px;
display: inline-block;
background-image: url("outliner.svg");
background-size: 500% 500%;
}
.circle { background-position: -32px 0;}
.disk { background-position: 0 -16px; }
</style>
</head>
<body>
<div>With CSS Sprite:</div>
<i class="circle"></i><i class="disk"></i>
<div>Without CSS Sprite:</div>
<i class="whole"></i>
</body>
</html>
【问题讨论】:
标签: css firefox svg css-sprites antialiasing