菜单栏鼠标经过伸缩效果

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <style type="text/css">
        *{
            margin: 0;
            padding: 0;
        }
        nav{
            height: 30px;
            width: 300px;
            margin: 50px auto;
            overflow: hidden;
            transition: 2s;
            border-radius: 15px;
        }
        nav:hover{
            height: 180px;
        }
        h2{
            background: orange;
            color: white;
            height: 30px;
            line-height: 30px;
        }
        nav:hover h2{
            background: black;
        }
        ul{
            background: orange;
            color: white;
        }
        ul li{
            height: 30px;
            line-height: 30px;
        }
        </style>
    </head>
    <body>
        <nav>
            <h2>菜单栏</h2>
            <ul>
                <li>首页</li>
                <li>首页</li>
                <li>首页</li>
                <li>首页</li>
                <li>首页</li>
            </ul>
        </nav>
    </body>
</html>

 

posted @ 2017-09-15 20:49  鱼樱前端  阅读(493)  评论(0编辑  收藏  举报