美文网首页
淘宝部分导航栏

淘宝部分导航栏

作者: DARKSIIIDE | 来源:发表于2019-01-17 21:05 被阅读0次

HTML

<body>
    <ul class="nav">
        <li class="list-item">
            <a href="#">天猫</a>
        </li>
        <li class="list-item">
            <a href="#">聚划算</a>
        </li>
        <li class="list-item">
            <a href="#">天猫超市</a>
        </li>
    </ul>
</body>

CSS

*{
    margin: 0px;
    padding: 0px;
    font-family: arial;
}
a{
    text-decoration: none;
}
.nav::after{
    content: "";
    display: block;
    clear: both;
}
.nav{
    list-style: none;
}
.nav .list-item{
    float: left;
    margin: 0 10px;
    height: 30px;
    line-height: 30px;/*使文字处在容器正中间*/
}
.nav .list-item a{
    padding: 0 5px;
    color: #f40;
    font-weight: bold;
    height: 30px;
    display: inline-block;
    border-radius: 15px;
}
.nav .list-item a:hover{
    background-color: #f40;
    color: #fff;
}

相关文章

网友评论

      本文标题:淘宝部分导航栏

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