ОБНОВЛЕНИЕ: это работает со мной, я только что попробовал:
<div style="max-width:980px;border:1px solid red;">
<div style="background:#EEE;float:left;">
<div style="width:auto;border:1px solid blue;float:left;">If you use 100% here, it will fit to the width of the mother div automatically.</div>
<div style="border:1px solid green;"> The div will be 100% of the mother div too.</div>
</div>
<div style="clear:both;"></div>
</div>
Это то, что вы хотите? Границы и фон просто показывают divs;)
Просто иди так:
Допустим, вы хотите, чтобы все div были максимальными. 980px (иначе просто оставьте это или замените на 100%) ...
<div style="max-width:980px;">
<div style="width:100%;">If you use 100% here, it will fit to the width of the mother div automatically.
</div>
<div style="width:100%;"> The div will be 100% of the mother div too.
</div>
</div>
Второй вариант: использовать еще один div ... или вы используете style="width:auto;"
для динамического div ...