似乎有一个简单的解决方法,但我无法弄清楚,更不用说找到答案,所以我会问。我所要做的就是让页面上水平居中的菜单“.nav”。问题是,我想要左侧的标志,它似乎与我集中导航导致混乱。页面中心的定位表
html,
body {
margin: 0;
padding: 0;
}
body {
background: url("http://i.imgur.com/4QGL09u.jpg") no-repeat center center fixed;
-wekit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
#top {
width: 100%;
background-color: rgb(000, 255, 000);
}
#logo {
float: left;
margin-left: 20px;
background-color: rgb(255, 000, 000);
}
.nav {
width: 200px;
display: table;
margin: auto;
}
.item {
display: table-cell;
padding: 10px;
}
<html>
<body>
<header>
<div id="top">
<img src="http://i.imgur.com/adZJ4Ln.png" alt="logo" id="logo">
<ul class="nav">
<li class="item">Home</li>
<li class="item">Projects</li>
<li class="item">Images</li>
<li class="item">More</li>
</ul>
</div>
</header>
</body>
</html>
你说的表,但你有一个菜单。也请搜索,这已被询问并回答很多次 – pol
我已经搜索了答案,并没有一个适用于我在这里试图做的。他们都表示“保证金:汽车”或类似的答案。 – Yama
这不是它的菜单,所以请提供jfiddle –