Css IE7的z指数问题
我遇到了z-index问题。我试图放置位置:相对和z-index。但问题仍然存在 下面是我的代码:Css IE7的z指数问题,css,Css,我遇到了z-index问题。我试图放置位置:相对和z-index。但问题仍然存在 下面是我的代码: <tr> <td colspan="2"> firstname</td> <td colspan="2"><table cellspacing='0' cellpadding='0' border='0' style='position:relative;float:left;'> <tr><td width="25%"
<tr>
<td colspan="2"> firstname</td>
<td colspan="2"><table cellspacing='0' cellpadding='0' border='0' style='position:relative;float:left;'>
<tr><td width="25%">
<div class="yui-skin-sam">
<div id="myAutoComplete">
<input id="myInput" type="text">
<div id="myContainer"></div>
</div>
</div>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2"> lastname</td>
<td colspan="2"><table cellspacing='0' cellpadding='0' border='0' style='position:relative;float:left;'>
<tr><td width="25%">
<input type="text" name="lastName"/>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2">address</td>
<td colspan="2"><table cellspacing='0' cellpadding='0' border='0' style='position:relative;float:left;'>
<tr><td width="25%">
<input type="text" name="address"/>
</tr>
</table>
</td>
</tr>
名字
姓氏
地址
请给出一些解决这个问题的建议
谢谢
Raj“在Internet Explorer中,定位元素生成一个新的堆叠上下文,从z索引值0开始。因此z索引无法正常工作。”
为了修复这个错误,请简单地对目标元素的父节点应用更高的z索引。例:
<div style="z-index: 3">
<div style="z-index:1;">
something here ....
</div>
</div>
我不确定你的z指数目标是什么,你可以把$('div')改成$('whateveryouwant'),这一切都取决于你的需要
详情:
你能提供一个屏幕截图来显示正在发生的事情吗?我尝试了很多方法,但都没有成功。你能告诉我如何更改上面的html内容以避免z索引问题吗?我已经更新了这篇文章,但是,你应该提供更完整的css/html供我们检查问题。
$(function() {
var zIndexNumber = 1000;
$('div').each(function() {
$(this).css('zIndex', zIndexNumber);
zIndexNumber -= 10;
});
});