Similar Question:
Is it possible to position items relatively or absolutely within a display: table-cell?
I am working with a display: table
layout example. You can view the demo here.
In the second panel, there is a #pos
div that has a position: absolute
property. Similarly, its parent element div#two
has a position: relative
. When I apply #pos { width:100% }
, shouldn't it inherit the width of div#two
? Instead, it seems to be getting the width of #wrapper
, the parent of div#two
.
Is this behavior typical for table-cell layouts? How can I ensure that div#pos
takes on the width of its parent without hardcoding values? Thank you for your help in advance.