CSS Transform-origin Changing with font-size

拥有回忆 提交于 2019-12-24 12:43:50

问题


I have created a simple SVG animation where it animates on click using a simple CSS transition and transform (see here: http://jsfiddle.net/T9hsW/1/).

I want the SVG to scale with the user's font-size so I sized it in ems. However, I noticed that if I increase the font-size of my browse using cmd-+ then when I click the SVG, the transform-origin appears to be the old transform origin, not the new one, even though I have used % to set the origin:

svg {
    width: 4em;
    height: 4em;
}
.arrow, .arrows {
    transform-origin: 50% 50%;
    ...
}

This is the desired output after clicking:

This is what it looks like if you increase the browser font size. Note that it is clearly off-center, probably using the original coordinates:

Is there anything I can do about this?

来源:https://stackoverflow.com/questions/23668969/css-transform-origin-changing-with-font-size

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