我正在处理很久以前写的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


trtable-row

关于html - HTML <tr>标签和position:relative,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/6746175/

10-12 12:32
查看更多