【发布时间】:2020-01-06 02:09:37
【问题描述】:
在我的 Web 应用程序中,我使用的是 SVG 图标,主要原因是我使用的数据不是多租户设计。我尝试了很多选项,但在 Internet Explorer 中几乎每个版本都不起作用。它显示 op 就像一个 o 填充块。
工作代码:Chrome / Mozilla / Safari
HTML:
<div class="svg_icon" id="icon_business"></div>
CSS:
#icon_business {
-webkit-mask-image: url(/svg/business.svg);
}
.svg_icon {
width: 100%;
height: 80px;
text-align: center;
mask-size: contain;
mask-repeat: no-repeat;
-webkit-mask-position-x: center;
-webkit-mask-size: contain;
-webkit-mask-repeat: no-repeat;
background-color: #00E3A7;
}
有人可以帮我吗?处理这个问题的最佳方法是什么?有没有办法与 IE 8 + 一起工作
【问题讨论】:
-
实际上我无法让它在 Firefox (68.0.2) 上运行 -> 全白或 Edge (17.17134) -> 全绿。我做了一个小提琴,因为我们无法访问您的 svg 图片:the fiddle。请注意,from MDN 根本不支持 Internet Explorer for
mask-image -
由于 IE 不支持 mask-image,作为一种解决方法,您可以使用 SVG 星形吗?如果是,那么您可以参考此示例。它正在与 IE 一起使用。参考:textuploader.com/1r4n0
标签: css internet-explorer svg internet-explorer-8 internet-explorer-11