CSS位置,与Web-kit和FF略有偏差
我有一个表格,其中的图像以绝对方式定位,因此它们将位于每列的边框上。我的问题是在 FF 中,我将它们排列得恰到好处,而在 Web-kit 浏览器中,它们被推到右侧约 6-7 像素?任何想法为什么,通常我在这些浏览器之间没有问题。 我正在使用 CSS Reset/
编辑:经过进一步审查,FF 似乎无法识别位置:相对于表格,但可以识别 DIV。 Webkit 浏览器确实可以识别 table 的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;
}
I have a table with images inside the a that are positioned with absolute, so they will be right on the border of each column. My issue is in FF i have them lined up just right and in the Web-kit browsers they are pushed to the right about 6-7 pixels? Any ideas why, usually I don't have issues between these browsers.
And I am using a CSS Reset/
EDIT: After further review it seems like FF does NOT recognize a position:relative to a table but will for a DIV. Webkit browsers do recognize position:relative set to a table. So in FF the position was based off the DIV and in Webkit browsers it was based off the TABLE.
Has anyone come across this before?????
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;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想说这和桌子有关系。
尝试将表格中的所有填充和边距设置为 0
。.....刚刚看到reset.css 部分.. 嗯
I would say it has something to do with the table.
Try setting all padding and margins in the table to 0.
.....Just saw the reset.css part.. hmmm