Hola, tengo el siguiente código. Quiero conseguir que el div "repeater" aumente de tamaño automáticamente según los hijos que le inserto, ya que no voy a saber el número de hijos exacto que va a tener el div. He probado con width:auto pero no funciona
Gracias
Código:
<div id="padre" style="position:absolute; left: 0px; top: 0px; height:300px; width: 500px; background-color: green; overflow: auto">
<div id="repeater" style="position:absolute;width: auto; left: 5px; top: 5px; padding:5px; background-color: white;">
<div id="elemento" style="position:relative; float:left; height: 300px; width: 200px;">
<div id="hijo" style="position: absolute; left: 0; top: 0; height:100px; width: 80px; background-color: red;">
</div>
</div>
<div id="elemento" style="position:relative; float:left; height: 300px; width: 200px;">
<div id="hijo" style="position: absolute; left: 0; top: 0; height:100px; width: 80px; background-color: blue;">
</div>
</div>
<div id="elemento" style="position:relative; float:left; height: 300px; width: 200px;">
<div id="hijo" style="position: absolute; left: 0; top: 0; height:100px; width: 80px; background-color: black;">
</div>
</div>
<div id="elemento" style="position:relative; float:left; height: 300px; width: 200px;">
<div id="hijo" style="position: absolute; left: 0; top: 0; height:100px; width: 80px; background-color: pink;">
</div>
</div>
</div>
</div>