CSS Positioning Absolute within table cells not working in Firefox

后端 未结 7 1157
礼貌的吻别
礼貌的吻别 2021-01-17 15:48

I cannot figure out this positioning problem in Firefox. It doesn\'t seem to follow the absolute positioning rule. Is there something I\'m doing that shouldn\'t be done, but

7条回答
  •  执笔经年
    2021-01-17 16:12

    There are legitimate reasons to use CSS display: table styling. It eliminates issues that display: block and display: inline-block do not address. These reasons occupy an entire chapter of a book on CSS styling so I won't go into them here. That same book also describes the problem of positioning within items with that display type. CSS 2.1 specs simply don't address the issue and Mozilla has chosen a course that ignores attempts to create a positioning context with those elements. CSS-table positioning is well established, mature methodology, and not "dodgy" - it just takes understanding of its limits - just like any other CSS element. For liquid layouts and other layouts where element size is variable or unknown it's indispensable for vertical spacing and positioning.

    One suggestion in this thread has been presented - create a div within the "table-cell" element set to position: relative and use that for the positioning context. The other method is to embed another CSS table within that cell and use it to position elements within a grid. The third method is to wrap your CSS table within another item that creates a positioning context.

提交回复
热议问题