【发布时间】:2014-02-14 21:32:14
【问题描述】:
我目前有一个transform: rotate(45deg),它使用复选框:checked 值应用,我正在寻找一种解决方案,以便CSS 过渡仅适用于转换值。现在我的设置如下:transition: all 1s ease。我不希望它适用于 all,只是转换。现在它正在将转换应用到 color: 更改,我想摆脱它。
我觉得这应该很容易找到答案,但事实证明它比我想象的要困难。如果您有任何问题,请告诉我。谢谢。
这是我的 code pen。有问题的代码是 CSS 第 25-28 行。
【问题讨论】:
-
使用
transform代替all但是,为了更好地用于前缀,它有点烦人。 bit.ly/1blrJOR -
@Markasoftware 我已经尝试过您的建议,但它只是完全删除了过渡。 codepen.io/mtthwbckmn/pen/ByFnj
-
@MattBeckham 大声笑,这是因为 Chrome 支持不带前缀的
transition,但它需要transform的前缀,如果它不带前缀,它支持transition。但是,您的transitionCSS 仅适用于transforms,而不是-webkit-前缀,所以...是的
标签: css transform css-transitions transition rotatetransform