【问题标题】:How make flexible blocks without flexbox for old IE如何为旧 IE 制作没有 flexbox 的灵活块
【发布时间】:2015-08-20 04:21:54
【问题描述】:

有一个关于简单表单的问题,有输入和按钮, Цe 需要一个块填充盒子内 100% 的可用空间,其中可能有其他元素,没有它们的包装。

使用 flexbox 很容易做到这一点,但它不支持 IE 8-9。 请帮我。谢谢,尤金。

【问题讨论】:

    标签: css cross-browser internet-explorer-9 flexbox


    【解决方案1】:

    使用 CSS 表格布局应该根据内容为您提供灵活性:http://jsfiddle.net/37rxjskx/

    .row {
        display: table;
        /* table-layout: fixed; */
        /* width: 100%; */
    }
    
    .col,
    button {
        display: table-cell;
        padding: 8px 12px;
        outline: 1px dashed red;
    }
    <div class="row">
        <div class="col">input auto 100% of the free width space</div>
        <button type="submit">button<br> auto of the<br> inner content</button>
    </div>

    table-layout: fixed 则相反:让浏览器应用您的宽度限制并忽略内容的相对数量。

    我以前就同一主题做过的各种回答:equal widthsame heightfill remaining space

    【讨论】:

      猜你喜欢
      • 2019-09-08
      • 1970-01-01
      • 1970-01-01
      • 2017-01-16
      • 1970-01-01
      • 2015-03-14
      • 1970-01-01
      • 1970-01-01
      • 2013-03-17
      相关资源
      最近更新 更多