Fading in and out divs with css

落爺英雄遲暮 提交于 2019-12-02 07:22:09

The reason your transition is cutting out like that is because you have the transition only on the :hover, what you've got to do is actually move that onto the selector you want to transition, so:

.collapsible, .page_collapsible {
    margin: 0;
    padding:8px;
    height:20px;
    border-top:#2b2b2b 1px solid;
    border-left:#2b2b2b 1px solid;
    border-right:#2b2b2b 1px solid;
    border-bottom:#2b2b2b 0px solid;
    background: black;
    font-family: Lato;
    text-decoration:none;
    text-transform:uppercase;
    color: #fff;
    font-size:1em;
    -o-transition:color .3s ease-out, background .5s ease-in-out;
  -ms-transition:color .3s ease-out, background .5s ease-in-out;
  -moz-transition:color .3s ease-out, background .5s ease-in-out;
  -webkit-transition:color .3s ease-out, background .5s ease-in-out;
  transition:color .3s ease-out, background .5s ease-in-out;
}

Here is the updated fiddle: http://jsfiddle.net/LJdAU/1/

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