Firefox忽略表单元格中的绝对定位 [英] Firefox ignores absolute positioning in table cells

查看:96
本文介绍了Firefox忽略表单元格中的绝对定位的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图绝对定位一个元素在表格单元格内。
TD有 position:relative ,元素有 position:absolute

I am trying to absolutely position an element inside a table cell. The TD has position:relative and the element has position:absolute.

这在所有浏览器中都很好用,除了在Firefox中它相对于祖先的相对容器定位。

This works great in all browsers except in Firefox where it is positioned relative to an ancestor relative container.

这个小提琴: http://jsfiddle.net/ac5CR/1/

有没有人知道我是否错过了一些可以在Firefox中修复的CSS设置?

Does anyone know if I miss some CSS setting that can fix that in Firefox?

推荐答案

元件。
添加到样式display:block,你将得到所需的行为。

the element is not a block element. add to the style display:block, you will get the needed behavior.

这篇关于Firefox忽略表单元格中的绝对定位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆