gpt4 book ai didi

html - 我们可以更改转换速记属性中参数的顺序吗?

转载 作者:行者123 更新时间:2023-11-28 05:55:46 24 4
gpt4 key购买 nike

转换速记属性的正确顺序如下

transition: <property> || <duration> || <timing-function> ;

最近我注意到在 Bootstrap 中他们更改了 .carousel-inner 的顺序分类为:

transition: .6s ease-in-out left;

即:transition: <duration> || <timing-function> || <property>

事实上,无论我们如何安排这三个参数,转换的效果都是一样的。那么问题来了,

我们可以更改转换速记属性中参数的顺序吗?参数的顺序真的很重要吗?

最佳答案

更新

@user31782 您曾评论说,除非同时存在持续时间和延迟,否则速记转换的顺序可能无关紧要。您的推论似乎是正确的:

Just space-separate all the individual values. The order doesn't matter except when using both duration and delay, they need to be in that order.

虽然这是指动画速记,但逻辑上假设这也适用于过渡速记属性:

  1. animationtransition速记属性在功能上非常相似。
  2. Bootstrap 混淆了顺序,但它仍然有效。


您确定级联下方没有其他转换吗?您是否检查了计算样式?

Note that order is important within the items in this property: the first value that can be parsed as a time is assigned to the transition-duration, and the second value that can be parsed as a time is assigned to transition-delay.

如果有多个<single-transition>简而言之,任何转换都具有“无”作为<single-transition-property> ,则声明无效。

https://www.w3.org/TR/css3-transitions/#transition-shorthand-property

关于html - 我们可以更改转换速记属性中参数的顺序吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37084691/

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