CSS CSS3 过渡 - 更改动画“锚点”?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9109319/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
CSS3 transition - change animation "anchor point"?
提问by shannoga
I am trying to use css3 transition to enlarge a div width and height on :hover.
我正在尝试使用 css3 过渡来放大 :hover 上的 div 宽度和高度。
It works fine but I need to change the anchor point of the animation.
它工作正常,但我需要更改动画的锚点。
As for now it is set to the bottom left of the div and I need it to be from the top left corner.
至于现在它被设置在 div 的左下角,我需要它从左上角开始。
Is that possible ?
那可能吗 ?
Thanks
谢谢
回答by Francisco Paulo
I think you might be looking for the transform-origin
property.
This allows you to say something like:
我想您可能正在寻找该transform-origin
物业。这允许你说:
transform-origin:left top;
You can find more information about it here: http://www.w3schools.com/cssref/css3_pr_transform-origin.asp
您可以在此处找到有关它的更多信息:http: //www.w3schools.com/cssref/css3_pr_transform-origin.asp
Hope this helps!
希望这可以帮助!