【问题标题】:The top border of the table disappears using style "overflow:hidden" and "border-collapse"表格的顶部边框使用样式“overflow:hidden”和“border-collapse”消失
【发布时间】:2009-10-23 19:00:02
【问题描述】:

看看下面的代码:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
<html>
<head></head>
<body>
<div style="float:left; overflow:auto; width:400px; height:300px;">
<table cellspacing="0" cellpadding="0" border="0" style="width:600px; border:solid 1px #999999; border-collapse:collapse;" ><tr><td>testing</td></tr></table>
</div>
</body>
</html>

表格的顶部边框在 Firefox 中消失。
有什么问题?

【问题讨论】:

    标签: css firefox


    【解决方案1】:

    我的第一个建议是从元素中删除显式的boder="0",看看是否会改变显示。

    【讨论】:

      【解决方案2】:

      我会在样式中添加table-layout: fixed;

          <table cellspacing="0" cellpadding="0" border="0" 
          class="width:600px; border:solid 1px #999999; 
          border-collapse:collapse; table-layout: fixed; ">
          <tr>
          <td>testing</td>
          </tr>
          </table>
      

      善良,

      【讨论】:

      • 我只是将代码从类更改为样式。问题出现了。
      • 已编辑其他建议
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-03-21
      • 1970-01-01
      • 2020-12-18
      • 2020-11-14
      • 2023-03-31
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多