居中我的导航菜单链接 [英] Centering my navigation menu links
本文介绍了居中我的导航菜单链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我只是不能看出这一点。我试过text-align:center; ,display:inline-block等等,但我只是无法弄清楚如何在#menu-bottom-nav中心导航。
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;}
任何帮助是值得赞赏的。
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>
这篇关于居中我的导航菜单链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文