transition-属性CSS真的能随便填吗?
Can we really fill anything we want in transition-property CSS?
我刚刚意识到我们可以在 transition-property
CSS 参数后面放置我们想要的任何类型的值,因为我只是这样做了(不是故意的)。然后我去了 see the MDN docs 他们可以填写任何自定义值 :
/* <custom-ident> values */
transition-property: test_05;
transition-property: -specific;
transition-property: sliding-vertically;
/* Multiple values */
transition-property: test1, animation4;
transition-property: all, height, all;
transition-property: all, -moz-specific, sliding;
所以我想知道:因为 test1
和 animation4
都不是有效的 CSS 属性,如果它不是 [=28],那是什么样的值=], 可以传入 transition-property
吗?关键帧?还有什么?
[编辑]:我为多个值添加了 MDN 给出的示例,其中一些 transition-property
没有填充有效的 CSS 属性。
如果我们继续阅读,您会看到不同的值如下:
none
No properties will transition.
all
All properties that can transition will.
<custom-ident>
A string identifying the property to which a transition effect should be applied when its value changes.
所以是的,您可以在此处放置您想要的内容,<custom-indent>
背后的想法是避免指定所有可用属性的详尽列表。因此,如果将来添加新的 属性,这将保持有效,我们不必更改它。
如果你输入类似 random_58468
的内容,它将是一个有效值,你不会收到警告,但当然不会发生任何事情,因为没有 属性 调用 random_58468
.
我刚刚意识到我们可以在 transition-property
CSS 参数后面放置我们想要的任何类型的值,因为我只是这样做了(不是故意的)。然后我去了 see the MDN docs 他们可以填写任何自定义值 :
/* <custom-ident> values */
transition-property: test_05;
transition-property: -specific;
transition-property: sliding-vertically;
/* Multiple values */
transition-property: test1, animation4;
transition-property: all, height, all;
transition-property: all, -moz-specific, sliding;
所以我想知道:因为 test1
和 animation4
都不是有效的 CSS 属性,如果它不是 [=28],那是什么样的值=], 可以传入 transition-property
吗?关键帧?还有什么?
[编辑]:我为多个值添加了 MDN 给出的示例,其中一些 transition-property
没有填充有效的 CSS 属性。
如果我们继续阅读,您会看到不同的值如下:
none
No properties will transition.
all
All properties that can transition will.
<custom-ident>
A string identifying the property to which a transition effect should be applied when its value changes.
所以是的,您可以在此处放置您想要的内容,<custom-indent>
背后的想法是避免指定所有可用属性的详尽列表。因此,如果将来添加新的 属性,这将保持有效,我们不必更改它。
如果你输入类似 random_58468
的内容,它将是一个有效值,你不会收到警告,但当然不会发生任何事情,因为没有 属性 调用 random_58468
.