I’ve run into what appears to be a CSS issue with IE8.
<html>
<body>
<div style="width:180px;">
<div style="text-align:center; border:1px solid black;">
<div style="width: 40%; background-color:red;">
<div style="width:180px; float:left;">
<div>Text</div>
</div>
<div style="clear: both"></div>
</div>
</div>
</div>
</body>
</html>
This gives me the following results:

The doctype is set to strict. The reason the text divs are in a div that can have a width of anywhere from 0-100% is to give that variable width div the proper height.
What do I need to do in order to achieve the first effect in IE8?
Some key elements to this are that the height cannot be fixed because the text could overflow the width of the box. The height of both the containing box and the “fill” needs to be able to vary based on content.
This solves the issue of a variable height:
HTML:
CSS:
Demo