Why does box B surround box A in the code below? Isn't float left on box A supposed to make them align horizontally?
<div style="width:300px">
<div style="width:45%;margin:5px;float:left;border:1px solid black">
<p>Box A</p>
This is just content for box A.
</div>
<div style="width:45%;margin:5px;border:1px solid red">
<p>Box B</p>
This is just content for box B.
</div>
</div>