HTML <tr> 标签和位置 :relative

标签 html css firefox

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

相关文章:

javascript - document.body.innerHTML = ""是否清除网页?

html - 在输入旁边放置一个按钮,适用于所有浏览器

php - 阻止用户未登录时访问

css - 有没有办法在 LESS 中编写自定义选择器?

html - 变换 : scale3d(1, 0.1, 1); ".1"太宽

Java-Applet 将不会在 Firefox 中释放焦点

html - 如何旋转立方体并使用 css html 扩展其边?

javascript - 隐藏/显示 div 不起作用

html - 有没有办法隐藏可调整大小的 div 右下角的小对 Angular 线?

html - 三列布局在 Google Chrome 中无法正常工作