Situation
html:
<div class="container">
<div class="parent">
<div class="child">x</div>
</div>
</div>
css:
.container {
display: table;
}
.parent {
display: table-cell;
position: relative;
}
.child {
position: absolute;
right: 0;
}
What I expect:
the .child
should be positioned to the right edge of .parent
. Works in Chrome.
What I get in Firefox:
the .child
is positioned to the right edge of the closest "non static" parent which is has not display: table-cell
.
Fiddle
Question
Why does display: table-cell
influence the positioning of child elements, or, why is position: relative
ignored on table-cell
elements? Can I work around this if I rely on table-cell
?