is there a way to auto adjust container DIV height to accomodate absolutely positioned child DIVs? i'd like to get something like
+-----------------------+ | container | | +------+ +------+ | | | chld | | chld | | | | 1 | | 2 | | | | | | | | | +------+ +------+ | | +------+ | | | chld | | | | 3 | | | | | | | +------+ | +-----------------------+
i try something like:
<div class="container" style="position: relative; border: solid thin">
<div class="chld" style="width: 20px;
height: 20px;
position: absolute; left: 5px; top: 5px;
border: dashed thin;"><div>
<div class="chld" style="width: 20px;
height: 20px;
position: absolute; left: 30px; top: 5px;
border: dashed thin;"><div>
<div class="chld" style="width: 20px;
height: 20px;
position: absolute; left: 15px; top: 30px;
border: dashed thin;"></div>
</div>
but the "container" div stays zero height. I understand, that this might be the expected behaviour, as elements are 'taken out' of the flow when positioned absolutely, but is there a workaround for this? (except for precalculating the resulting height and setting it manually)