二级菜单

Posted badren

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了二级菜单相关的知识,希望对你有一定的参考价值。

html
        <ul>
            <li> <a href="#">1-1</a> </li>
            <li> <a href="#">1-2</a> </li>
            <ol>
                <li> <a href="#">1-2-1</a> </li>
                <li> <a href="#">1-2-2</a> </li>
            </ol>
        </ul>
    
    CSS:
        *{
          margin:0;
          padding=:0;
        }
        a{
        text-decoration:none;
        color:red;
        }
        li{
            list-style:none;
            float:left;
            width:200px;
            height:40px;
            line-height:40px;
            text-align:center;
            }    
        ol li{
            display:none;(隐藏二级菜单)
             }
        ul>li:hover ol li{
            display:black;
            background-color:blue;
            }
        ul>li:hover{
            background-color:pink;
            }
        ul>li:hover a{
            color:green;
            }








































以上是关于二级菜单的主要内容,如果未能解决你的问题,请参考以下文章