【发布时间】:2013-12-27 22:46:42
【问题描述】:
我遇到了背景大小的 IE 9/10 的问题
.svg {
padding: 20px 20px 20px 120px;
border: 1px solid #ccc;
line-height: 60px;
background-image: url(data:image/svg+xml;base64,...);
background-size: 100px;
background-repeat: no-repeat;
}
如果具有背景的元素没有定义宽度,则背景的大小似乎默认为原始 svg 图像的大小。
在此示例中,图像以 16x16 像素而不是 100x100 像素呈现。
我一直在使用 :after 伪元素来解决这个问题。但我是不是做错了什么?
【问题讨论】:
-
background-size应该在 IE9/10 中工作,所以可能是 SVG 的问题。我已经使用this polyfil 让background-size在 IE8 中工作,也许它可以帮助你。
标签: css