0
   <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

2 Answers 2

2

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>
Sign up to request clarification or add additional context in comments.

Comments

0

Set height to 100 to for main div

1 Comment

i dont want set height for main div

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.