Firefox 是否支持位置:相对于表格元素? [英] Does Firefox support position: relative on table elements?

查看:25
本文介绍了Firefox 是否支持位置:相对于表格元素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试在 上使用 position:relative/position: absolute 在 Firefox 中它似乎不起作用.

解决方案

最简单也最恰当的方法是将单元格的内容包装在一个 div 中并添加 position:relative 到那个 div.

示例:

<div style="position:relative">这将正常定位<div style="position:absolute; top:5px; left:5px;">这将位于相对于单元格的 5,5

</td>

When I try to use position: relative / position: absolute on a <th> or <td> in Firefox it doesn't seem to work.

解决方案

Easy and most proper way would be to wrap the contents of the cell in a div and add position:relative to that div.

example:

<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>

这篇关于Firefox 是否支持位置:相对于表格元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
前端开发最新文章
热门教程
热门工具
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆