CSS3 Animate Out of :hover

杀马特。学长 韩版系。学妹 提交于 2019-12-03 02:55:09

You don't need keyframes for something as simple as this.

I made you a demo (with only -webkit vender prefixes to keep things simple).

This can also be done with CSS transitions, it's less powerful but simpler. The idea is to have a div containing the top and bottom links but it is bigger than the wrapper div so that parts are hidden. When you hover over it, it reduces height so the links are visible. To make it animate back and forth you add the "transition : height 1s" to the css of the div. If I'll have the time later, I'll try to write it.

I believe if you add the animation to the non-hover state, you can get them to transition back. See my super-simple example here.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!