【发布时间】:2017-01-08 03:52:53
【问题描述】:
由于某种原因,Microsoft Edge 不允许您对 SVG 内的元素进行转换。填充工作正常(所以我知道元素定位正在工作)但转换被完全忽略。这在 chrome 中可以正常工作,据我所知,应该在 Edge 中也可以正常工作。
HTML:
<div class="test-container">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 300 400" xmlSpace="preserve">
<g id="Type">
<g>
<rect x="100" class="st1" id="rect1" width="100" height="100"/>
<rect x="100" y="100" class="st1" id="rect2" width="100" height="100"/>
</g>
</g>
</svg>
</div>
CSS:
.test-container {
width: 100px;
}
#rect1 {
fill: blue;
transform: translate(50px);
}
#rect2 {
fill: red;
}
在此处查看 codepen 示例:http://codepen.io/dwolfand/pen/pEzQgy
有什么想法吗?
【问题讨论】:
-
内部 SVG 元素尚不支持 MSFT 浏览器上基于 CSS 的转换。请改用 SVG 变换。
标签: css svg transform microsoft-edge