我有一个表格,其中 a 内的图像使用绝对定位,因此它们将位于每列的边框上。我的问题是在 FF 中我让它们排列得恰到好处,在 Web-kit 浏览器中它们被推到右边大约 6-7 像素?任何想法为什么,通常我在这些浏览器之间没有问题。 我正在使用 CSS Reset/
编辑:经过进一步审查,FF 似乎无法识别相对于表的位置,但会识别 DIV。 Webkit 浏览器确实识别 position:relative 设置为表格。所以在 FF 中,位置基于 DIV,而在 Webkit 浏览器中,它基于 TABLE。
有没有人以前遇到过这个?????
HTML:
<td class="tri-img">
<img class="one" src="img/triangles/triangle20.png" alt="" >
<span class="tri-val one">30%</span>
</td>
<td class="tri-img">
<img class="two" src="img/triangles/triangle20.png" alt="" >
<span class="tri-val one">30%</span>
</td>
CSS:
.tri-graph .tri-col td.tri-img{
position: relative;
color:#ffffff;
}
.wrap-graph.relative img{
position: absolute;
cursor: pointer;
bottom:1px;
z-index: 1;
}
.wrap-graph.relative img.one{
left:53px;
}
.wrap-graph.relative img.two{
left:91px;
}
最佳答案
我会说它与 table 有关。
尝试将表格中的所有填充和边距设置为 0。
.....刚看到reset.css部分..嗯
关于Css 位置,与 Web-kit 和 FF 略有不同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5663863/