This is because floated content does not take up any space. Your parent main_div division essentially takes on a height of 0 because it has no other content, which "hides" the background (there is no height to display behind).
This information is available in the css-floating tag wiki and I've also posted other more detailed information about floating and parent containers.