呼叫..导航精灵不会再上你的帮助家伙对准
不知道这里发生了什么,我的导航翻车没有正确对齐,我检查我的测量,从我看到它是不是。我使用Margin:0 auto将导航对齐到页面的中心位置:我想知道这是否是问题?
我创建了一个小提琴http://jsfiddle.net/ca9rv/来理解我在漫无目的的感觉(不知道为什么在底部有一条蓝线 - 这在本地查看我的html页面时不显示)。
<ul id="navigation">
<li id="home"><a href="index.html">Home</a></li>
<li id="promise"><a href="Our Promise">Our Promise</a></li>
<li id="restaurants"><a href="Our Restaurants">Resume</a></li>
<li id="contact"><a href="#">Contact</a></li>
</ul>
#navigation {
background:url(http://img33.imageshack.us/img33/7388/navigationq.png) no-repeat;
width: 940px;
height: 50px;
margin: 0 auto;
padding: 0;
margin-bottom:20px;
}
#navigation li, #navigation a {
height: 50px;
display: block;
}
#navigation li {
float: left;
list-style: none;
display: inline;
text-indent: -9999em;
}
#home { width: 103px; }
#promise { width: 176px; }
#restaurants { width: 206px; }
#contact { width: 151px; }
#home a:hover { background:url("http://img33.imageshack.us/img33/7388/navigationq.png") 0px -50px no-repeat; }
#promise a:hover { background:url("http://img33.imageshack.us/img33/7388/navigationq.png") -103px -50px no-repeat; }
#restaurants a:hover { background:url("http://img33.imageshack.us/img33/7388/navigationq.png") -277px -50px no-repeat; }
#contact a:hover { background:url("http://img33.imageshack.us/img33/7388/navigationq.png") -482px -50px no-repeat; }
谢谢Joacim,我看到你的出发点 - 因某种原因图像窝棚调整我的形象,我没有注意到,直到几分钟前。请看我上面给罗希特的评论。再次感谢。 – Ria 2013-05-02 09:56:49