练习4:导航栏

导航栏



<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>导航条</title>
    <link rel="stylesheet" href="../效果/reset.css">
    <style>
        .nav{
            width: 1206px;
            height: 48px;
            background-color:#e6e7e2 ;
            margin: 100px auto;
        }


        .nav li{
            float: left;
            /* 高度居中 */
            /* height: 48px; */
            line-height: 48px;
            
        }

       .nav a{
           /* 转换成块元素 */
            display: block;
            /* 字体颜色 */
            color: #9b9c97;
            /* 去掉下划线 */
            text-decoration: none;
            /* 字体大小 */
            font-size: 20px;
            /* 使居中 */
            padding: 0px 40px;
        }

        .nav a:hover{
            background-color: #a2a39d;
            color: aliceblue;
        }


    </style>
</head>
<body>
    
    <ul class="nav">
        <li>
            <a href="">HTML/CSS</a>
        </li>
        <li>
            <a href="">Browser Side</a>
        </li>
        <li>
            <a href="">Server Side</a>
        </li>
        <li>
            <a href="">Programming</a>
        </li>
        <li>
            <a href="">XML</a>
        </li>
        <li>
            <a href="">Web Building</a>
        </li>
        <li>
            <a href="">Reference</a>
        </li>
    </ul>
</body>
</html>

 

 

posted @ 2022-04-21 14:56  Eveeee  阅读(22)  评论(0)    收藏  举报