Borders not shown in Firefox with border-collapse on table, position: relative on tbody, or background-color on cell

后端 未结 7 2043
余生分开走
余生分开走 2020-11-30 01:58

Consider the following HTML:

<
7条回答
  •  渐次进展
    2020-11-30 02:48

    Just to put all in one place.

    The problem is produced when you have a cell with position relative inside a table with collapsed borders (as Boris indicated and filled in the bug https://bugzilla.mozilla.org/show_bug.cgi?id=688556)

    This can be easily solved using CSS as indicated by user2342963 (Adding background-clip: padding-box to the cell).

    You can see the problem (with Firefox) and the fix here: http://jsfiddle.net/ramiro_conductiva/XgeAS/

    table {border-spacing: 0px;}
    td {border: 1px solid blue; background-color: yellow; padding: 5px;}
    td.cellRelative {position: relative;}
    td.cellRelativeFix {background-clip: padding-box;}
    table.tableSeparate {border-collapse: separate;}
    table.tableCollapse {border-collapse: collapse;}
    
    
    position: relative position: static
    position: relative position: static
    position: relative position: static

提交回复
热议问题