嗨!我在IE7中遇到了z-index的问题。我有一张桌子,用户被要求输入地址。 postalCode的javascript验证器框“formStatusBoxContainer”出现在选择框后面,下一行显示图标“formStatusIcon”。任何想法如何解决这个问题?除了移动盒子。在FF和IE8中一切看起来都很好。IE7 z-index问题
<tr class="rowBack2">
<th width="150px">Postleitzahl:</th>
<td>
<input type="text" name="postalCode" value="" >
<span style="position: relative;">
<span class="formStatusBoxContainer">
<img src="/images/formfield_default.gif" class="formStatusIcon"
id="postalCodeIcon">
<span class="formStatusBoxTooltip" style="display: none;"
id="postalCodeStatus">
<div class="formStatusBoxInner" id="postalCodeStatusInner">
Bitte geben Sie die Postleitzahl ein.
</div>
</span>
</span>
</span>
</td>
</tr>
<tr class="rowBack1">
<th width="150px">Land:</th>
<td>
<span style="position: relative;">
<select name="country" id="country">
<option value="AX">Aland Inseln</option>
<option value="DZ">Algerien</option>
<option value="AD">Andorra</option>
</select>
</span>
<span class="formStatusBoxContainer">
<img src="/images/formfield_ok.gif" class="formStatusIcon" id="countryIcon">
<span class="formStatusBoxTooltip" style="display: none;" id="countryStatus">
<div class="formStatusBoxInner" id="countryStatusInner">Land</div>
</span>
</span>
</td>
</tr>
CSS工具提示:
.formStatusBoxContainer { position:relative; }
.formStatusIcon { position:relative; top:0px;margin-left:5px;z-index:2; }
.formStatusBoxTooltip {
position:absolute;
left:35px;
top:-5px;
width:150px;
background:#7EA822;
padding:1px;
border-right:2px solid #666666;
border-bottom:2px solid #666666;
z-index:3;
}
CSS表格行:
只是字体,边距和Tab键。没有什么位置或z-index应该影响。
要回答你的两个答案。它不在选择框上。有一个图标'formStatusIcon',弹出窗口也显示在后面。也在上面一行的输入字段后面。看起来弹出窗口落在整个下一行的后面? – heffaklump 2010-08-27 08:24:11