码迷,mamicode.com
首页 > 其他好文 > 详细

导航栏制作

时间:2017-08-02 15:34:15      阅读:111      评论:0      收藏:0      [点我收藏+]

标签:tle   20px   isp   联系我们   class   meta   块元素   :hover   行高   

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <style>
            *{
                margin: 0px;     /*盒子外边距*/
                padding: 0px;    /*盒子内边距*/
            }
            .NavigatorView {
                width: 100%;
                height: 50px;
                background-color: WhiteSmoke;
                
            }
            .NavigatorView div{
                height: 50px;
                width: 80%;
                margin-left: 12%;
                margin-right: 12%;
                
            }
            .NavigatorView div ul {
                list-style-type: none;   /*去掉ul的无标号的 点, 即 无标记    */
            }
            .NavigatorView div ul li {
                float: left;            /* 左浮动 */
            }
            
            .NavigatorView div ul li a {
                display: block;        /* 块状显示,在元素后面换行,显示下一个块元素*/
                height: 50px;
                width: 130px;
                text-align:center;
                text-decoration: none;   /*去除链接下的横线*/
                line-height: 50px;        /*文本行高*/
                color:black;
            }
            .a1 {
                background-color: YellowGreen;
            }
            .NavigatorView div ul li a:hover{
                background-color: YellowGreen;
                height: 50px;
                width: 130px;
                text-align:center;
                display: block;
                text-decoration: none;   /*去除链接下的横线*/
                line-height: 50px;
                color: black;
            }    
            
            .head {
                height: 120px;
                width: 100%;
                background-color: aliceblue;
                
            }        
        </style>
    </head>
    <body>
        <div class="head"></div>
        <div class="NavigatorView">
            <div>
                <ul>
                    <li><a class="a1"  href="#">首页</a></li>
                    <li><a href="#">走进韵维</a></li>
                    <li><a href="#">新闻中心</a></li>
                    <li><a href="#">展示中心</a></li>
                    <li><a href="#">联系我们</a></li>
                    <li><a href="#">加入我们</a></li>
                    
                </ul>
            </div>
            
        </div>
    </body>
</html>

 

导航栏制作

标签:tle   20px   isp   联系我们   class   meta   块元素   :hover   行高   

原文地址:http://www.cnblogs.com/qmqn/p/7274075.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!