【问题标题】:css border-bottom iexplorercss 边框底部 iexplorer
【发布时间】:2017-01-12 00:09:36
【问题描述】:

css:

.item_fact{
     border-bottom:#CCCCCC 1px solid;
}

html:

<table>
  <tr class="item_fact">
    <td> hello </td>
    <td> world </td>
  </tr>
</table>

IE7 不显示底部边框,但 Firefox 和 Chrome 可以! 我怎样才能破解这个CSS?

【问题讨论】:

    标签: html css html-table


    【解决方案1】:

    正确的 css 语法应该是:

    border-bottom:大小样式颜色;

    所以,在你的情况下:

    border-bottom: 1px 实心#CCCCCC;

    编辑:实际上,TR 似乎并不像它“包含”IE7 中的 TD 元素一样。您可以做的一个技巧是让表格折叠边框,然后应用 .item_fact 下的所有 TD 以使边框底部自己。

    像这样:

    <html>
    <head>
    <style type="text/css">
    table {
        border-collapse: collapse;
    }
    .item_fact td {
         border-bottom:1px solid #CCCCCC;
    }
    </style>
    </head>
    <body>
    <table>
      <tr class="item_fact">
        <td> hello </td>
        <td> world </td>
      </tr>
    </table>
    </body>
    </html>
    

    【讨论】:

      【解决方案2】:

      IE/css 不支持行的边框。您需要为单元格加边框。

      .item_fact td {
        border-bottom:1px solid #ccc;
      }
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-12-25
        • 1970-01-01
        • 1970-01-01
        • 2015-02-19
        • 2015-07-03
        • 2013-11-21
        • 2015-10-08
        • 1970-01-01
        相关资源
        最近更新 更多