【发布时间】:2020-04-22 23:09:30
【问题描述】:
我有一张桌子,放在一个 div 里面。这个表有 4 个 td 元素,在每个 td 元素内,有 3 个 div 从上到下堆叠。我的目标是使第三个 div 位于表格的底部。下面的 CSS:
tr {
height: 220px;
}
td {
position: relative;
}
third-div {
text-align: center;
position: absolute:
left: 0;
right: 0;
bottom: 0;
}
在 Firefox 和 chrome 中运行良好,但在 IE11 中的 bottom:0 无法正常运行,我遇到了文本覆盖问题:(第三个 div 中的数字,即 2000,未在表格底部设置) html rendered in IE
预期的是: html rendered in Chrome
我尝试将高度设置为 auto/100%,但没有成功。我在开发人员工具中手动单击了底部:0,它起作用了,2000 到了底部。 (不知道为什么)。
【问题讨论】:
-
请添加 HTML 示例代码以便测试。确保 td 的高度设置为 100% 和 bottom: 0 !important to 3rd-div
标签: css internet-explorer css-position