我想在叠加层上显示特定的表格行。它在Firefox中工作,但不是Safari。我不明白这是如何实现的,因为Firefox和Safari通常会让这些类型的东西变得相同。CSS z-index问题:适用于Firefox,但不适用于Safari?
<body>
<style>
.overlay {
position:absolute;
width:100%;
height:100%;
background:#000;
opacity: 0.5;
}
</style>
<table>
<tr style="position:relative; z-index:1000; background:#fff;">
<td>show this one on top</td>
</tr>
<tr>
<td>Show these below</td>
</tr>
<tr>
<td>Show these below</td>
</tr>
<tr>
<td>Show these below</td>
</tr>
</table>
<div class="overlay"></div>
</body>
这是什么导致Safari和Firefox之间的这种差异?
明显。问题在于Firefox以何种方式渲染它,以及我需要改变什么,以便Safari能够匹配它在Firefox中的外观? – Andrew 2010-09-30 19:14:10
对不起,我误解了你的问题。我做了一些测试,但无法弄清楚如何让你的解决方案在Safari中运行。它看起来像一个td(或tr)不能显示比它在Safari中的父表更大的z-index。我现在唯一能想到的解决方案是将其分成两个不同的表格(具有相同的宽度)......一个在覆盖层之上有一个Z索引,另一个在其下面有一个Z索引。 – MattHughesATL 2010-10-01 13:35:26