CSS Display None And Opacity Animation With Keyframes Not Working
Answer : 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 ;) If you are using @keyframes you should use -webkit-animation instead of -webkit-transition . Here is the doc for @keyframes animation: https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Using_CSS_animations. See code snippet below: .parent { background-color: #000; color: #fff; width: 500px; height: 500px; padding: 5px; } .myDiv { display: none; opacity: 0; padding: 5px; color: #600; background-color: #cec; } .parent:hover .myDiv { display: block; opacity: 1; /* "both" tells the browser to use the above opacity at the end of the animation (best practice) */ -webkit-animation: display-none-transition 1s both; animation:...