We learned that absolute
, fixed
positioning and float
properties, get the elements out of the normal flow.
So Well, take a look at this example: http://jsfiddle.net/WKQgL/1/
<div class="pink float"></div>
<div class="blue float"></div>
<div class="green"></div>
<div class="orange"></div>
The two first boxed are floated left and out of normal flow, so the second two boxes fill their space, Therefore the Green box goes under the Red.
But, how about this one? http://jsfiddle.net/WKQgL/24/
<div class="pink float"></div>
<div class="blue float"></div>
<div class="yellow">Well, why this text is out of the DIV?</div>
<div class="green"></div>
<div class="orange"></div>
We see that the text doesn't go beneath the boxes and take place in the bottom of them, so why?
In another example: There is a paragraph and a floated image:
<img src="example.jpg" style="float:right">
<p>This is a long paragraph surrounding the image</p>
In the result we see a floated image in the right, that the paragraph surrounded it. Compare that when we use absolute
for the image, then the texts go under the image. We said that absolute
and float
take the element out of the normal flow, so what's the difference?