Show child div on mouse hover of parent - needs javascript?

前端 未结 7 2011
悲哀的现实
悲哀的现实 2021-02-01 13:27

I need to show a div when you house over its parent (default is for the child div to be hidden). Is the only way to do this with javascript? Thanks

7条回答
  •  悲哀的现实
    2021-02-01 13:47

    @jdln; yes

    css:

    .outer {
        background:red;
        height:100px;
    }
    .box1 {
        background:blue;
        height:100px;
        width:80px;
        display:none;
    }
    .outer:hover .box1{
        display:block;
        cursor:pointer;
    }
    

    check the fiddle: http://jsfiddle.net/sandeep/XLTV3/1/

提交回复
热议问题