web------下拉菜单

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Cl_Daisy/article/details/78100277

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <style>
            .a{
                width: 205px;

            }

            .b{
                width: 200px;
                height: 50px;
                background-color: limegreen;
                text-align: center;
                line-height: 50px;
                color: #ffffff;
            }

            .c{
                width: 200px;
                height: 300px;
                background-color: gainsboro;
                display: none;
                /*visibility: hidden;*/
            }

            ul{
                list-style: none;
                margin-left: -40px; 
            }
            ul li{
                line-height: 50px;
                display: block;
                width: 200px;
                text-align: center;
            }

            .a:hover{
                cursor: pointer;
            }

            .a:hover .c{
                display: block;
            }

            .a:hover .b{
                background-color: green;
            }

            li:hover{
                background-color: gray;
                color: #FFFFFF;
            }

        </style>
    </head>
    <body>

        <div class="a">

            <div class="b">
                关于我们
            </div>

            <div class="c">
                <ul>
                    <li>公司简介</li>
                    <li>董事长致辞</li>
                    <li>企业文化</li>
                    <li>团队风采</li>
                </ul>
            </div>

        </div>

    </body>
</html>

效果图在这
html 下拉菜单

猜你喜欢

转载自blog.csdn.net/Cl_Daisy/article/details/78100277
今日推荐