Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道如何将 SASS 中的列表元素设置为开始,display:none然后在动画开始时制作它display:block,然后在动画结束时将其更改background-color:#fff为白色 100%
display:none
display:block
background-color:#fff
在这里演示
您不能使用display:none,因为您的元素将无法接收动画样式。相反,我会使用visibility: hidden. 此外,如果希望您的样式在动画完成后仍然存在,那么您应该使用animation-fill-mode: forwards. 在此处查看演示。
visibility: hidden
animation-fill-mode: forwards
我不太确定你的动画到底会是什么样子。
但试图将其作为您解决问题的参考:
这是 DEMO在此处输入链接描述