I'm trying to understand how float works with different elements. The first example have 2 <div>
which is floated to left
with one of the div having some text. As expected, both are placed next to each other horizontally.
The second example have the same setup except that the last <div>
with text is not floated to left. Now, I was expecting that <div>
to go underneath the first floated <div>
. But, the result is different. The second <div>
went beneath the first <div>
but the text is placed under the first <div>
.
Can anyone explain me what's happening?