【问题标题】:Adjust fieldset according to inner table根据内表调整字段集
【发布时间】:2012-10-24 10:14:16
【问题描述】:

我有这个代码:

<fieldset>
 <label>show/hide table</label>
  <table class="tableStyle2">
    table code - a wide table
  </table>
</fieldset>

字段集在 Chrome 和 Firefox 中会自动调整其宽度,但在 IE8 中不会。有解决办法吗? 试过了:

.tableStyle2 {
    border-collapse: collapse;
    font-family: 'Lucida Grande','Lucida Sans Unicode','Verdana,Arial,Helvetica,sans-serif';
    width: 100%;
    font-size: 12px;
    overflow: none;
}

【问题讨论】:

    标签: html css html-table internet-explorer-8 fieldset


    【解决方案1】:

    将disply:inline-block 添加到fieldset

    fieldset{width:auto; display:inline-block}​
    

    DEMO

    【讨论】:

      【解决方案2】:

      您是否尝试将宽度样式直接应用于字段集属性?

      <fieldset style="width: 100%;">...</fieldset>
      

      【讨论】:

      • 谢谢哥们。 "width=auto;" 对我不起作用。这很好用。
      猜你喜欢
      • 2015-04-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-08
      • 1970-01-01
      • 2012-10-29
      • 2016-11-25
      相关资源
      最近更新 更多