gpt4 book ai didi

css - CSS transition-property 的允许属性

转载 作者:行者123 更新时间:2023-11-28 09:47:57 25 4
gpt4 key购买 nike

是否有可以使用 CSS3 转换进行转换的实际属性列表?例如,显示属性目前无法转换,但可见性可以(尽管只是从隐藏到可见,没有持续时间)。

有一个注释 MDN上面写着:

Note: The set of properties that can be animated is subject to change; as such, you should avoid including any properties in the list that don't currently animate, because someday they might, causing unexpected results.

但是,我无法从 transition-property spec 中看到目前允许哪些属性。

这完全取决于浏览器实现还是在某处定义?

最佳答案

对于创建 CSS Transitions Module 时存在的属性,可以在规范本身中找到列表:

http://www.w3.org/TR/css3-transitions/#animatable-properties

对于 future 的属性或对现有属性的 future 更改,请参阅Animatable 行规范中的属性:

For properties that exist at the time this specification was developed, this specification defines whether and how they are animated. However, future CSS specifications may define additional properties, additional values for existing properties, or additional animation behavior of existing values. In order to describe new animation behaviors and to have the definition of animation behavior in a more appropriate location, future CSS specifications should include an "Animatable:" line in the summary of the property's definition (in addition to the other lines described in [CSS21], section 1.4.2). This line should say "no" to indicate that a property cannot be animated or should reference an animation behavior (which may be one of the behaviors in the Animation of property types section above, or may be a new behavior) to define how the property animates. Such definitions override those given in this specification.

例子:

enter image description here

There's also a list on the MDN itself.

关于css - CSS transition-property 的允许属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25872767/

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