围绕我的导航菜单链接我的、菜单、链接

2023-09-11 23:35:49 作者:没房没车木有钻戒

我只是似乎无法想出解决办法。我试过文本对齐:中心; ,显示:inline-block的多,但我只是无法弄清楚如何将#菜单底部导航中心内我的导航

I just can't seem to figure this out. I've tried text-align: center; , display: inline-block and more but I just cant figure out how to center my navigation within the #menu-bottom-nav.

CSS

#menu-bottom-nav { width: 600px; height: 70px; margin: 0px auto;}
#menu-bottom-nav li { list-style-type: none; float: left; margin-right: 20px;}

任何帮助是AP preciated。

Any help is appreciated.

推荐答案

尝试了这一点:

<!DOCTYPE>

<html>
<head>
    <title>Test</title>

    <style type="text/css">
        #menu-bottom-nav {
            margin: 0;
            padding: 0;
            width: 600px;
            text-align: center;
            border: 1px solid #000;
        }

        #menu-bottom-nav li {
            list-style-type: none;
            margin-right: 20px;
            border: 1px solid #ff0000;
            display: inline-block;
            *display: inline;
            zoom: 1;
        }
    </style>
</head>
<body>
    <ul id="menu-bottom-nav">
        <li>Test</li>
        <li>Test2</li>
        <li>Test3</li>
    </ul>
</body>
</html>
 
精彩推荐
图片推荐