+ -
当前位置:首页 → 问答吧 → 在firefox中,设置div的position为absolute的时候,被其遮住的连接无法点击

在firefox中,设置div的position为absolute的时候,被其遮住的连接无法点击

时间:2010-09-09

来源:互联网

如:
<div style=" position:absolute;width:973px; height:97px; left:50%; margin-left:-486px;top:0px; z-index:1;"></div>
<table width="1003" height="98" border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td><a href="http://www.touch-ok.cn"><img src="logo_touch" height="80" width="150"></a></td></tr></table>


这时,firefox上,img的连接点不了,其他浏览器可以。请高手赐教,在线等,解决马上结贴。

作者: sth_i_love   发布时间: 2010-09-09

顶一下,别沉了,高手赶紧帮下我嘛

作者: sth_i_love   发布时间: 2010-09-09

好像只有IE可以点吧…………
IE中不设置背景色的元素遮住其他元素后,其他元素还可以响应事件,但是在Firefox/Chrome/Safari中是不可以的。
可以提高table的层叠级别,使table覆盖div。
<div style=" position:absolute; width:973px; height:97px; left:50%; margin-left:-486px;top:0px;border:1px solid red; z-index:1;"></div>
<table width="1003" height="98" border="0" align="center" cellpadding="0" cellspacing="0" style="position:relative; z-index:2;">
  <tr>
  <td><a href="http://www.touch-ok.cn"><img src="logo_touch" height="80" width="150"></a></td>
  </tr>
</table>

详细的分析,可以看看这篇文章:http://www.w3help.org/zh-cn/causes/BT9029

作者: WebAdvocate   发布时间: 2010-09-09

谢谢2楼的回答,虽然能实现点击,但是换了层的顺序,问题还是同样存在,不过也学到东西了,如果没有更好的答案,分就给你吧。

作者: sth_i_love   发布时间: 2010-09-09

热门下载

更多