position: 'sticky'
登陆 Chrome 56 ,但在某些情况下它使边框不可见。
考虑以下示例:
table {
border-collapse: collapse;
}
thead {
position: sticky;
top: 0;
}
th {
background-color: #fff;
border-right: 5px solid red;
}
<table>
<thead>
<tr>
<th>First</th>
<th>Second</th>
<th>Third</th>
</tr>
</thead>
</table>
在 Chrome 56.0.2924.76 中,只有最后一个 <th>
的边框是可见的,并且只有在 <th>
background-color
这是 Chrome 中的错误吗?
原文由 Misha Moroshko 发布,翻译遵循 CC BY-SA 4.0 许可协议
似乎强制回流将部分帮助:
background-clip
似乎也有效且无害: