gpt4 book ai didi

css - 如何过渡仅旋转变换?

转载 作者:技术小花猫 更新时间:2023-10-29 10:16:13 26 4
gpt4 key购买 nike

我正在使用一堆元素组成背景图像,它们都绝对定位,自由旋转。

问题是,我只想转换那些对象的旋转,而不是顶部或左侧属性。显然 transition: transform 30s; 是不允许的。我有一个绝妙的主意:

transition:all 30s ease-out;
transition: left 0s;
transition: top 0s;

但这也行不通。我该如何解决这个问题?

最佳答案

Transform 是供应商前缀

代替

transition:all 30s ease-out;
transition: left 0s;
transition: top 0s;

-webkit-transition: -webkit-transform $amount-of-time ease-out;
-moz-transition: -moz-transform $amount-of-time ease-out;
-o-transition: -o-transform $amount-of-time ease-out;
-ms-transition: -ms-transform $amount-of-time ease-out;
transition: transform $amount-of-time ease-out;

关于css - 如何过渡仅旋转变换?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17578431/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com