CSS Transition on Hover

后端 未结 6 791
再見小時候
再見小時候 2021-01-28 13:50

I have a problem. I actually try to do a transition at a div when I hover the mouse over an object. So basically I have a div, and when I hover my mouse the div, it should displ

6条回答
  •  既然无缘
    2021-01-28 14:35

    Use the pseudo selector :hover.

    #first:hover > #on-hover{
        opacity:1;
    }
    
    #on-hover{
        opacity:0;
        -webkit-transition: opacity 0.5s;
    }
    
    #first{
        width:300px;
        height:200px;
    }
    

    http://jsfiddle.net/charlescarver/V8PK3/1/

提交回复
热议问题