小编Bal*_*lix的帖子

使用Internet Explorer在表格单元格中定位绝对

我有一个表结构,我需要嵌套元素来获取表格单元格的所有大小.所以我把它设置为绝对并将其所有位置定义为0,它在FireFox和Chrome上工作得很好但在IE上却不行:(

这是标记:

<div class="table">
    <div class="cell">
      <figure class="illustration">My illustration</figure>
    </div>
</div>
Run Code Online (Sandbox Code Playgroud)

CSS:

.table {
    display: table;
    width: 400px;
}

.cell {
  position: relative;
    display: table-cell;
    height: 600px;
    background-color: grey;
}

.illustration {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: red;
    color: #fff;
}
Run Code Online (Sandbox Code Playgroud)

这是我的笔:http: //codepen.io/balix/pen/qEMwzj

如果你看到红色背景就可以了;)

IE的任何黑客攻击?

html css internet-explorer css-position

7
推荐指数
2
解决办法
3121
查看次数

标签 统计

css ×1

css-position ×1

html ×1

internet-explorer ×1