【发布时间】:2012-07-27 18:44:37
【问题描述】:
希望有人可以帮助我解决我在使用 IE 时遇到的这个问题。所以我正在处理的页面有一张包含 Facebook、Twitter 和 Youtube 选项卡的图片。
除了 Internet Explorer (7/8) 之外,所有这些选项卡在大多数其他浏览器 (Chrome/Safari/Firefox/Opera) 中都是可点击的。我不确定我在这里做错了什么,有人可以帮助我吗?
HTML(已编辑):
<div id="head">
.
.
.
<div id="icons">
<ul class="nav1">
<li></li>
<li><a id="facebook" rel="_blank" href="https://www.facebook.com"> </a></li>
<li><a id="twitter" rel="_blank" href="https://twitter.com"> </a></li>
<li><a id="youtube" rel="_blank" href="https://www.youtube.com"> </a></li>
</ul>
</div>
.
.
.
</div>
CSS(已编辑):
#icons {
position:absolute;
top:44px;
right:200px;
z-index:9;
float:left;
/*width:105px;*/
height:35px;
/*background:url(/images/sprite_header_icons.png) no-repeat -6px 0;*/
}
#icons ul.nav1{
height: 35px; /*added*/
}
#icons ul.nav1 li {
display: inline;
padding-left: 1px;
height: 35px !important; /*added*/
}
#icons ul.nav1 li a {
display: inline;
/*width: 34px;
height: 31px;*/
}
ul.nav1 li a:hover {
}
#icons ul.nav1 li a#facebook {
padding-left: 20px;
padding-right: 13px;
padding-bottom: 28px;
background:url(/images/sprite_header_icons.png) no-repeat -6px 0; /*added*/
width: 20px; /*added*/
height: 35px; /*added*/
}
#icons ul.nav1 li a#twitter {
padding-left: 20px;
padding-right: 13px;
padding-bottom: 28px;
background:url(/images/sprite_header_icons.png) no-repeat -40px 0; /*added*/
width: 20px; /*added*/
height: 35px; /*added*/
}
#icons ul.nav1 li a#youtube {
padding-left: 20px;
padding-right: 13px;
padding-bottom: 28px;
background:url(/images/sprite_header_icons.png) no-repeat -74px 0; /*added*/
width: 20px; /*added*/
height: 35px; /*added*/
}
注意:
好的,所以我根据 Ryan Beaulieu、Alex Reynolds 和 OhMrBigshot 的建议进行了一些更改。现在,选项卡在 IE (7/8) 中是可点击的……但是,这些选项卡是部分可见的(li 38px x 16px),如下所示:
宽度很好,但是如何将高度从 16px 增加到 35px? 谢谢!!
【问题讨论】:
-
我可能是错的,但可能是因为锚标签之间没有任何内容
-
@Ryan,我希望不是这样,因为我不能在这些标签之间放置任何东西......它假设只需点击图像的不同部分即可工作
-
您正在测试哪个版本的 IE?
-
@RyanBeaulieu:看起来你是对的......如果我在标签之间添加一些东西,我看到鼠标指针变为可点击的“手”......但是,这搞砸了一切: (但谢谢你的想法:)我会继续玩它
标签: css internet-explorer hyperlink image clickable