小编典典

Firefox 是否支持 position: relative 在表格元素上?

all

当我尝试在 a或Firefox 中使用position: relative/时,它似乎不起作用。position: absolute``<th>``<td>


阅读 138

收藏
2022-08-29

共1个答案

小编典典

简单且最合适的方法是将单元格的内容包装在一个 div 中并添加 position:relative 到该 div。

例子:

<td>
  <div style="position:relative">
      This will be positioned normally
      <div style="position:absolute; top:5px; left:5px;">
           This will be positioned at 5,5 relative to the cell
      </div>
  </div>
</td>
2022-08-29