CSS图像翻转链接问题-无法让导航在IE中水平显示
是的,我在这个上画了一个空白,在玩了一下之后,CSS 并不像我希望的那么整洁。导航/翻转图像在 Firefox 中按照我想要的方式工作,但我无法在 IE 中工作。 IE 基本上将翻转链接堆叠在一起。 http://www.plumberkendal.co.uk <--- 已上传至此处,您可以有点明白我的意思了。
1)显示方式:内嵌; /// 似乎杀死了 IE 和 FF 中的链接。
2)显示:inline-block; /// 这也是现在的设置,它似乎适用于 FF 和 chrome,但不适用于 IE。非常感谢任何帮助!
CSS
#nav_bar
{
margin-top: 10px;
float: right;
}
#navigation li, #navigation a
{
height:32px; display: inline-block;
}
#navigation li
{
margin:0; padding:0;
list-style: none outside none;
display: inline-block;
}
#home li, #home a{width: 90px;}
#home{left: 0px; width: 90px;}
#home {background: url('../images/nav_bar.png') 0 0; }
#home a:hover {background: url('../images/nav_bar.png') 0 -39px; }
#portfolio li, #portfolio a {width: 128px; }
#portfolio {left: 91px; width: 128px; }
#portfolio {background: url('../images/nav_bar.png') -94px 0px; }
#portfolio a:hover{background: url('../images/nav_bar.png') -94px -39px;}
#contact li, #contact a {width: 90px; }
#contact {left: 130px; width: 90px; }
#contact { background: url('../images/nav_bar.png') -306px 0px; }
#contact a:hover {background: url('../images/nav_bar.png') -306px -39px; }
HTML
<div id="nav_bar">
<ul id="navigation">
<li id="home"><a href="index.php"><span>home</span></a></li>
<li id="portfolio"><a href="portfolio.php"><span>portfolio</span></a></li>
<li id="contact"><a href="contact.php"><span>contact</span></a></li>
</ul>
</div>
Yeah I've drawn a blank on the this one, and after playing about with it a bit the css isn't as neat as I'd like it to be. The navigation / roll-over images work the way I want in Firefox, but I can't get it working in IE. IE stacks the rollover links on top of each other basically. http://www.plumberkendal.co.uk <--- its uploaded here, and you can sorta see what I mean.
1) display: inline; /// seems to kill the links in both IE and FF.
2) display: inline-block; /// This is what it is set too now, which appears to work FF and chrome but not IE. Any help greatly appreciated!
CSS
#nav_bar
{
margin-top: 10px;
float: right;
}
#navigation li, #navigation a
{
height:32px; display: inline-block;
}
#navigation li
{
margin:0; padding:0;
list-style: none outside none;
display: inline-block;
}
#home li, #home a{width: 90px;}
#home{left: 0px; width: 90px;}
#home {background: url('../images/nav_bar.png') 0 0; }
#home a:hover {background: url('../images/nav_bar.png') 0 -39px; }
#portfolio li, #portfolio a {width: 128px; }
#portfolio {left: 91px; width: 128px; }
#portfolio {background: url('../images/nav_bar.png') -94px 0px; }
#portfolio a:hover{background: url('../images/nav_bar.png') -94px -39px;}
#contact li, #contact a {width: 90px; }
#contact {left: 130px; width: 90px; }
#contact { background: url('../images/nav_bar.png') -306px 0px; }
#contact a:hover {background: url('../images/nav_bar.png') -306px -39px; }
HTML
<div id="nav_bar">
<ul id="navigation">
<li id="home"><a href="index.php"><span>home</span></a></li>
<li id="portfolio"><a href="portfolio.php"><span>portfolio</span></a></li>
<li id="contact"><a href="contact.php"><span>contact</span></a></li>
</ul>
</div>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试使用此代码(尚未测试过,但我认为它应该有效):
Try with this code (haven't tested it, but I think it should work):