其他分享
首页 > 其他分享> > 新浪导航栏

新浪导航栏

作者:互联网

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>新浪</title>

    <style>

        .nav{

            border-top: 3px solid #ff8500;

            border-bottom: 1px solid #edeef0;

            height: 41px;

            background-color: #fcfcfc;           

        }

        a{

            height: 41px;

            line-height: 37px;

            font-size: 14px;

            color: black;

            text-decoration: none;

            display: inline-block;

            padding: 0 20px;

        }

        .nav a:hover{

            height: 41px;

            color: orange;

            background-color: black;

        }

    </style>

</head>

<body>

    <div class="nav"> 

        <a href="#">设为首页</a>

        <a href="#">手机新浪网</a>

        <a href="#">移动客户端</a>

        <a href="#">博客</a>

        <a href="#">微博</a>

        <a href="#">关注我</a>

    </div>

</body>

</html>

总结:1、注意选择器显示的优先级,网页默认链接格式的优先级大于继承

          2、选择链接的显示需要设置背景颜色不要设置成文字颜色

标签:color,导航,height,black,新浪,41px,nav,border
来源: https://blog.csdn.net/WebWyb/article/details/111053628