Div with floating div inside, will not match the content
<div style="background-color:black">
<div style="float:right">
Test message
</div>
<div>
This will show a “test message” on a white background, because the parent div does not match the content.
How to make div suitable for content? (without using a table or display: a table since it is not supported in IE)
A common solution is to install <br style="clear: both;">after the floating element clears the float and forces the parent to wrap the elements.
<div style="background-color:black">
<div style="float:right">
Test message
</div>
<br style="clear: both;">
<div>
Besides the problem, I would suggest putting styles in a separate CSS file if it is not already implemented.
This seems to be an old clearfix problem. This is almost a complete necessity when using css and floats for layouts. See http://www.webtoolkit.info/css-clearfix.html for a brief description and fix. Or for a deeper overview, see here http://www.positioniseverything.net/easyclearing.html