Does Firefox support position: relative on table elements?

后端 未结 9 1118
Happy的楠姐
Happy的楠姐 2020-11-22 12:49

When I try to use position: relative / position: absolute on a or in Firefox it doesn\'t seem to wo

相关标签:
9条回答
  • 2020-11-22 13:37

    Starting with Firefox 30, you'll be able use position on table components. You can try for yourself with the current nightly build (works as standalone): http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk/

    Test case (http://jsfiddle.net/acbabis/hpWZk/):

    <table>
        <tbody>
            <tr>
                <td style="width: 100px; height: 100px; background-color: red; position: relative">
                    <div style="width: 10px; height: 10px; background-color: green; position: absolute; top: 10px; right: 10px"></div>
                </td>
            </tr>
        </tbody>
    <table>
    

    You can continue to follow the developers' discussion of the changes here (the topic is 13 years old): https://bugzilla.mozilla.org/show_bug.cgi?id=63895

    Judging by recent release history, this could be available as soon as May 2014. I can barely contain my excitement!

    EDIT (6/10/14): Firefox 30 was released today. Soon, table positioning won't be an issue in major desktop browsers

    0 讨论(0)
  • 2020-11-22 13:51

    As of Firefox 3.6.13, position: relative/absolute do not seem to work on table elements. This seems to be long standing Firefox behaviour. See the following: http://csscreator.com/node/31771

    The CSS Creator link posts the following W3C reference:

    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. http://www.w3.org/TR/CSS21/visuren.html#positioning-scheme

    0 讨论(0)
  • 2020-11-22 13:55

    That should be no problem. Remember to also set:

    display: block;
    
    0 讨论(0)
提交回复
热议问题