HTML< tr>标签和位置:相对 [英] HTML <tr> tag and position:relative

查看:518
本文介绍了HTML< tr>标签和位置:相对的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很久以前就处理html writen,并且FireFox有一个问题。

一些tr元素的position属性设置为relative,这令人惊讶地使得tr的invisble的边框。当我删除样式,它一切正常...所以问题是:

位置:相对影响tr元素?我不能得到它。

感谢



编辑

 < table id =table1width =100%cellspacing =0cellpadding =0border =0 bgcolor =#cccccc>< tbody> 
< tr class =headerstyle =position:relative; top:2 px;>
< th> sdf< / th>
< th> sdf< / th>
< th> sdf< / th>
< / tr>

.header {
position:relative;
}



表#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;

}


解决方案

m也不完全确定没有看到代码,但:



从规范: http://www.w3.org/TR/CSS21/visuren.html#propdef-position


'position:relative'对table-row-group,
table-header-group,table-footer-group, table-row, -group,
table-column,table-cell和table-caption元素未定义。


tr 是一个表格行


I am dealing with html writen long time ago and there is a problem with FireFox.
Some tr elements have position property set to relative , which surprisingly makes the border of those tr's invisble. When I remove the style, it all works fine... so the question is:
"How does position:relative affect tr element?" I can't get it.. for me it seems redundant.

Thanks

EDIT:

<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;

}

解决方案

I'm also not entirely sure without seeing code, but:

From the spec: 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 is a table-row.

这篇关于HTML&lt; tr&gt;标签和位置:相对的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆