简体   繁体   English

CSS3-转换延迟仅在关闭时?

[英]CSS3 - transition-delay only on close?

a {
background: white;    
transition: background 1s ease;
transition-delay: 1s;
}

b {
background: black;
}

This makes the transition close after 1s, but also start. 这使过渡在1s后关闭,但也开始。 Would it be possible to make it open immediately but close after 1s? 是否可以使其立即打开但在1秒后关闭?

Use the following code instead of yours. 使用以下代码代替您的代码。 Let me know : 让我知道 :

a {
  background: white;    
  transition: background 1s ease;
  transition-delay: 0s;
  transition-duration:5s;
  }

b {
 background: black;
 }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM