Say you have a div
, give it a definite width
and put elements in it, in my case an img
and another div
.
The idea
As Lucas says, what you are describing is the intended behaviour for the float property. What confuses many people is that float has been pushed well beyond its original intended usage in order to make up for shortcomings in the CSS layout model.
Have a look at Floatutorial if you'd like to get a better understanding of how this property works.