美文网首页
简易css导航条

简易css导航条

作者: 嘬烟盒的程序员 | 来源:发表于2016-12-24 16:57 被阅读0次
    <style>
    *{
    margin: 0;
    padding: 0;
    }
    li{
    list-style: none;
    }
    a{
    text-decoration: none;
    }
    .nav{
    width:100%;
    height:40px;
    background: #222222;
    margin-top: 10px;
    }
    .nav .last{
    width:1000px;
    height:40px;
    margin: 0 auto;
    }
    .last li{
    float: left;
    position: relative;
    }
    .last li:hover .down{
    display: block;
    }
    .last li>a{
    padding: 0 30px;
    line-height: 40px;
    display: block;
    color:#aaa;
    font-size: 16px;
    }
    .last li .down{
    width:150px;
    background: #333;
    position: absolute;
    left:0;
    top:40px;
    display: none;
    }
    .last li .down a{
    display: block;
    line-height: 30px;
    color: #aaa;
    font-size: 14px;
    padding-left:30px;
    }
    .last li:hover>a{
    background: #333;
    color:#fff;
    }
    .last li .down a:hover {
    color:#fff;
    }
    </style>
    <script src="jquery-1.7.2.js"></script>
    <!--<script src="style.js"></script>-->
    </head>
    <body>
    <div class="nav">
    <ul class="last">
    <li><a href="javascript:;">首页</a></li>
    <li>
    <a href="javascript:;">职业课程</a>
    <div class="down">
    <a href="javascript:;">课程库</a>
    <a href="javascript:;">课程库</a>
    <a href="javascript:;">课程库</a>
    <a href="javascript:;">课程库</a>
    </div>
    </li>
    <li>
    <a href="javascript:;">就业学习</a>
    <div class="down">
    <a href="javascript:;">web前端开发</a>
    <a href="javascript:;">js前端开发</a>
    <a href="javascript:;">web前端开发</a>
    </div>
    </li>
    <li>
    <a href="javascript:;">社区</a>
    <div class="down">
    <a href="javascript:;">技术问答</a>
    <a href="javascript:;">社群</a>
    <a href="javascript:;">资源</a>
    </div>
    </li>
    <li>
    <a href="javascript:;">社区++</a>
    <div class="down">
    <a href="javascript:;">高校合作</a>
    <a href="javascript:;">人才联盟</a>
    <a href="javascript:;">资源</a>
    </div>
    </li>
    </ul>
    </div>
    </body>
    </html>
    

    相关文章

      网友评论

          本文标题:简易css导航条

          本文链接:https://www.haomeiwen.com/subject/sbzlvttx.html