tags:

views:

30

answers:

2
   <div style="width: 800px;border:1px solid black">
          <div style="width:100px;height:100px;float:left;border:1px solid black"></div>
          <div style="float:left">ssdfsdfsdfsdgfag25w6a4g8w5614w5sge16dgf45d4sdffffffffffffffffffffffffffffffffffffffffffffffffffffff5s4f64s6f456a46f456a456456456f456we4f54we5gf45456v4sd5646sadf54s56f465as4f564as56f</div>
          <div style="clear:both"></div>
    </div>

It end up like this: alt text how to fix it

A: 

set height to 100 to for main div

Grumpy
i dont want set height for main div
meotimdihia
+2  A: 

put a width on the 2nd child div. you will also need to put a space in that string as it cannot wrap it across lines.

 <div style="width: 800px;border:1px solid black">
          <div style="width:100px;height:100px;float:left;border:1px solid black"></div>
          <div style="float:left; width: 100px">ssdfsdfsdfsdgfag25w6a4g8w5614w5sge16dgf45d4sdffffffffffffffffffffffffffffffffffffffffffffffffffffff5s4f64s6f456a46f456a456456456f456we4f54we5gf45456v4sd5646sadf54s56f465as4f564as56f</div>
          <div style="clear:both"></div>
    </div>
iain