W3C 规范中 position 是可以使用在任何元素上的,但 position:relative 却有部分例外:

The effect of position:relative on table-row-group, table-header-group, table-footer-group, table-row, table-column-group, table-column, table-cell, and table-caption elements is undefined.

经测试,在浏览器(IE 除外)中给 table 定义 position:relative 属性是无效的。如果的确需要在表格中使用该属性,建议在单元格中嵌套一个 div 元素,再在其上设置 position:relative 属性来模拟。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-12
  • 2022-12-23
  • 2022-12-23
  • 2022-02-24
  • 2022-12-23
猜你喜欢
  • 2021-09-29
  • 2022-12-23
  • 2022-12-23
  • 2021-09-15
  • 2021-10-04
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案