CSS display none and opacity animation with keyframes not working

前端 未结 8 2042
广开言路
广开言路 2020-12-01 10:43

I have a very basic piece of HTML with the objective of animating from display: none; to display: block with opacity changing from 0 to 1.

8条回答
  •  猫巷女王i
    2020-12-01 11:41

    The display doesn't work with CSS transition or animation.

    Use opacity, visibility or z-index. You can combine all them.

    Try to use visibility: visible in place display: block and visibility: hidden in place display: none.

    And finally, combine z-index: -1 and z-index: 100 for example.

    Good work ;)

提交回复
热议问题