CSS how to make an element fade in and then fade out?

后端 未结 5 573
没有蜡笔的小新
没有蜡笔的小新 2020-11-29 20:11

I can make an element with an opacity of zero fade in by changing its class to .elementToFadeInAndOut with the following css:

.elementToFadeInAndOut {
    op         


        
5条回答
  •  离开以前
    2020-11-29 20:58

    A way to do this would be to set the color of the element to black, and then fade to the color of the background like this:

    
    

    I am FADING!

    I hope this is what you needed!

提交回复
热议问题