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

标签 html css internet-explorer css-position

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

这是标记:

<div class="table">
    <div class="cell">
      <figure class="illustration">My illustration</figure>
    </div>
</div>

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;
}

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

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

任何 IE 黑客?

最佳答案

我有同样的问题。
如果有人仍在寻找解决方法,您需要在 .cell 中创建一个容器

.cell > div{
    height:100%;
    width:100%;
    position:relative;
}

关于html - 使用 Internet Explorer 在表格单元格中定位绝对值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28961722/

相关文章:

javascript - 如何在 HTML + CSS 中重新创建 eBay 新 Logo 页面

html - 我可以使用 <nav> 标签作为文章标签列表吗?

javascript - 不是将 MySQL 数据从表格显示到 HTML 表格中,而是将其显示在可编辑的文本框上

css - first 和 end 之间 li 的不同风格

CSS 保持悬停元素打开,直到另一个元素悬停

html - 如何判断是什么导致 Internet Explorer 发出安全警告

javascript - font Awesome 无法在 ie9 和 ie11 兼容模式下工作

html - Material Design Lite CSS/JS 行为与 VUE.js 不一致

javascript - 根据类 react 悬停动画

ruby-on-rails-3 - Rails 3.1 Assets 管道 - IE 未加载开发中的所有样式表