CSS css3 特定属性的过渡延迟

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9840288/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 03:22:49  来源:igfitidea点击:

css3 transition delay of specific attribute

csscss-transitions

提问by test

at the moment I am styling a textbox by changing its background-color and font color on hover :

目前我正在通过在悬停时更改其背景颜色和字体颜色来设置文本框的样式:

transition: background-color 1s, color 1s;

I would now like to change the color after the background color by using transition-delay. The problem is that transition delay does not take the PROPERTY (i.e. color) that I would like to delay. Is there any way to delay specific attributes only?

我现在想通过使用过渡延迟来更改背景颜色之后的颜色。问题是过渡延迟不会占用我想延迟的属性(即颜色)。有没有办法只延迟特定属性?

回答by noponies

Transition Delay is property specific.

转换延迟是特定于属性的。

For instance

例如

transition: background-color 1s linear 2s, color 1s;
transition: property name | duration | timing function | delay

When using shorthand, it seems as though you need to specify the timing function as well.

使用速记时,似乎还需要指定计时功能。

(Source)

来源