CSS Animation property stays after animating

后端 未结 4 1602
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-04 18:28

I\'m trying to get a CSS animation property to stay after completing, is this possible?

This is what I\'m trying to achieve...

The element should be hidden w

4条回答
  •  借酒劲吻你
    2020-12-04 19:13

    In addition to the answer of @Fabrizio Calderan, it has to be said that you can even apply the animation-fill-mode property forwards directly to animation. So the following should also work:

    @keyframes fadeIn {
      0% {
        opacity: 0;
      }
      100% {
        opacity: 0.9;
      }
    }
    
    h2 {
      opacity: 0;
      animation: fadeIn 1s ease-in-out 3s forwards;
    }
    
    

    Test

提交回复
热议问题