html5 横向滑动导航栏

以下是一个简单的 HTML5 横向滑动导航栏的示例:

```html
<!DOCTYPE html>
<html>
<head>
    <title>横向滑动导航栏</title>
    <style>
        nav {
            overflow-x: auto;
            white-space: nowrap;
            background-color: #333;
            padding: 10px;
        }

        nav a {
            display: inline-block;
            color: white;
            text-align: center;
            padding: 14px;
            text-decoration: none;
            font-size: 17px;
        }

        nav a:hover {
            background-color: #ddd;
            color: black;
        }
    </style>
</head>
<body>
    <nav>
        <a href="#">首页</a>
        <a href="#">新闻</a>
        <a href="#">产品</a>
        <a href="#">关于我们</a>
        <a href="#">联系我们</a>
        <a href="#">加入我们</a>
        <a href="#">反馈</a>
        <a href="#">帮助</a>
        <a href="#">设置</a>
        <a href="#">退出</a>
    </nav>
</body>
</html>

猜你喜欢

转载自blog.csdn.net/YDHIT/article/details/131010556