【问题标题】:Additional hidden form input, causes table cell to expand on IE7 (screenshot)额外的隐藏表单输入,导致表格单元格在 IE7 上展开(截图)
【发布时间】:2014-05-18 06:35:21
【问题描述】:

这是我见过的最奇怪的事情之一, 我在表格单元格中有一个表格,其中包含隐藏的输入。 我注意到在 IE7 中,一旦隐藏输入超过 1 个,单元格就会展开。

这是一个屏幕截图(说三个但也有两个):

这是 HTML:

<table border="1" class="fix">
    <col style="width:150px;" />
    <col style="width:200px;" />
    <col style="width:200px;" />
    <col style="width:200px;" />
    <col style="width:190px;" />
      <tr>
        <td class="cell"></td>
        <td class="cell"></td>
        <td class="cell"><form action="a.php" method="GET">
          <input name="a" type="hidden" value="1"/>
          <input name="b" type="hidden" value="2"/>
          <div class="button-zone"><input type="submit" class="button" value="ABCDEF GEHIJKLM"></div></form></td>
        <td class="cell"></td>
        <td class="cell"></td>
      </tr>
</table>

一旦我删除输入 b 行(我需要),单元格看起来很正常。

这是 CSS:

table.fix {
     table-layout: fixed;
}

table.fix td { 
overflow: hidden;
}

td {
    padding: .31em 1em 2em 1em;
    text-align: left;
}

.cell {
    background-color: gray;
    padding-bottom: 12px;
    padding-left: .44em;
}

.button-zone {
    float: left;
    margin-left: 0px;
    position: relative;
}

.button {
    background-color: yellow;
    font-family: Arial;
    font-weight: bold;
    color: black;
    border: 0;
    overflow: visible;
    font-size: 16px;
    padding: 4px 20px 4px 8px;
}

IE7 上会出现这种情况,有什么方法可以在不修改大小的情况下解决这个问题?

【问题讨论】:

    标签: html css internet-explorer cross-browser internet-explorer-7


    【解决方案1】:

    你可以这样设置 CSS:

    input[type="hidden"]{
        height:0;
    }
    

    【讨论】:

    • 这没有任何区别,对不起
    猜你喜欢
    • 1970-01-01
    • 2012-11-12
    • 1970-01-01
    • 1970-01-01
    • 2016-03-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-14
    相关资源
    最近更新 更多