CSS transform on SVG Elements IE9+

我与影子孤独终老i 提交于 2019-12-03 04:41:48

IE11 supports the transform attribute in SVG even though it doesn't recognize the CSS style. See https://connect.microsoft.com/IE/feedback/details/811744/ie11-bug-with-implementation-of-css-transforms-in-svg.

Fortunately, you can simply set the attribute to match the style using JavaScript:

var g= document.querySelector('.st8'),
    transform= getComputedStyle(g).getPropertyValue('transform');

g.setAttribute('transform', transform);

Working Fiddle

Although IE9+ support CSS3 transforms, they don't support them on SVG and to the best on my knowledge it can't be done in CSS.

source: caniuse under known issues for CSS3 Transforms http://caniuse.com/#feat=transforms2d

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!