Positioning of div inside display:table-cell in IE 10

て烟熏妆下的殇ゞ 提交于 2019-12-23 12:15:04

问题


Trying to understand why IE9-10 is choking on something that IE7,8, FF, WK all render as expected.

Is there any trick to getting IE 9-10 to correctly respect the inherent height of a 'table cell'. (Important note: due to a variety of reasons I cannot use height:100% on the 'cell' div.)

http://jsfiddle.net/swortis/fCn8Y/

HTML:

<div class="table">
  <div class="row">
    <div class="cell">
      <div class="wrapper">
        <div class="content"></div>
      </div>
    </div>
  </div>
</div>

CSS:

    <style>

      html,
      body {
        height: 100%;
        margin: 0;
      }

     .table {
       display:table;
       height: 100%;
       width: 200px;
     }

    .row {
      display: table-row;
      }

    .cell {
      display: table-cell;
      vertical-align:top;
      }

    .wrapper {
      display:table;
      position: relative;
      height: 100%;
      width: 100%;
      }

   .content {
      position: absolute;
      background: red;
      width: 100%;
      height: 100%;
    }

  </style>

来源:https://stackoverflow.com/questions/17848409/positioning-of-div-inside-displaytable-cell-in-ie-10

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!