【发布时间】:2018-10-12 22:25:39
【问题描述】:
我正在尝试开发具有固定标题和固定多列的表格。
我为此使用了position: sticky,它在 Chrome/Safari/Firefox 中运行良好,但我在 Microsoft Edge 中发现了问题。
如果您使用position:sticky; top: 0; 创建元素并使用position: sticky; left: 0; 插入其他元素,Edge 将忽略嵌套元素。
在 Edge 中打开此示例并检查:https://codepen.io/finethanks/pen/aRWByx
是Edge的bug吗?
.wrapper {
border: 1px solid #ccc;
width: 200px;
height: 200px;
overflow: auto;
}
.content {
width: 1000px;
height: 1000px;
}
.sticky-wrapper {
height: 30px;
background: red;
position: sticky;
top: 0;
}
.item {
width: 50px;
height: 20px;
background: yellow;
position: sticky;
left: 0;
}
<div class="wrapper">
<div class="content">
<div class="sticky-wrapper">
<div class="item"></div>
</div>
</div>
</div>
【问题讨论】:
标签: html css css-position microsoft-edge