我正在处理很久以前写的 html,FireFox 有问题。
某些 tr 元素的 position 属性设置为 relative ,这令人惊讶地使这些 tr 的边框不可见。当我删除样式时,一切正常...所以问题是:
“position:relative 如何影响 tr 元素?”我无法理解。对我来说这似乎是多余的。
谢谢
编辑:
<table id="table1" width="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="#cccccc"><tbody>
<tr class="header" style="position:relative;top:2 px;">
<th>sdf</th>
<th>sdf</th>
<th>sdf</th>
</tr>
.header {
position:relative;
}
table#table1 {
border-collapse: collapse;
}
#table1 th {
border-collapse: collapse;
cursor: pointer;
font-size: 8pt;
padding: 3px;
border-left: 1px solid #666666;
border-right: 1px solid #666666;
border-bottom: 1px solid #666666;
color: #FFFFFF;
background-color: #6685C2;
}
#table1 td {
border-collapse: collapse;
cursor: pointer;
font-size: 8pt;
padding: 3px;
border: 1px solid #666666;
}
最佳答案
如果没有看到代码,我也不能完全确定,但是:
来自规范:http://www.w3.org/TR/CSS21/visuren.html#propdef-position
The effect of 'position:relative' on table-row-group, table-header-group, table-footer-group, table-row, table-column-group, table-column, table-cell, and table-caption elements is undefined.
tr
是一个table-row
。
关于HTML <tr> 标签和位置 :relative,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6746175/