Say you have a div, give it a definite width and put elements in it, in my case an img and another div.
div
width
img
The idea
Put your floating div(s) in a div and in CSS give it overflow:hidden; it will work fine.
div(s)
overflow:hidden;