In the following trivial html code:
<body>
<div style="float:left">text 1</div>
<div style="margin-left:10px">text 2</div>
</body>
why does this not separate “text 1” from “text 2”? I.e. this ends up producing “text 1text 2”. Apparently the margin is taken against the body, not the first div. So, if I put do “margin-left:100px”, then they show separation, because text1 is less than 100px wide.
Thanks
First try the following as you will see that 100px is not enough, because you just float the first div but the second div will append right next to the first one.
You have to float the second div, too.