小编use*_*463的帖子

如何居中对齐菜单中的项目?

如何居中对齐菜单中的项目?(lis)我设法使菜单(ul)居中于我的网站页面内,但我无法使菜单中的实际项目居中(首页,关于等)。

您可以在此处编辑我的HTML / CSS:http : //jsfiddle.net/66reH/
要查看结果

CSS / HTML:

#nav {
	font-family: Century Gothic, Arial, Helvetica, sans-serif;
	font-size: 15px;
	color: #fff;
	margin-left:auto;
	margin-right:auto;
	background-color: #eee;
	padding: 5px;
	height: 38px;
	width: 913px;
	font-weight: bold;
	border-style:solid;
	border-width:4px;
	border-color: #000;
}
#nav ul {
	padding: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	margin-left: 170px;
}
#nav ul li {
	list-style-type: none;
	text-align: center;
	float: left;
	margin: 0px;
}
#nav ul li a {
	text-decoration: none;
	color: #000; …
Run Code Online (Sandbox Code Playgroud)

html css menu html-lists nav

4
推荐指数
1
解决办法
2万
查看次数

标签 统计

css ×1

html ×1

html-lists ×1

menu ×1

nav ×1