xkrja
06-24-2009, 03:55 AM
Check at the code below. The outer div has a red background but this is not shown because I use "float: left" on the inner divs. So if "float: left" is used it manage to disable the auto-height in the outer div. If the "float: left" property is removed from both inner divs the auto-height on the outer div works and the background is red.
Why is that? It's really annoying since I have to set a fix height manually on the outer div to get the background color to the height I want.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div style="background: Red;">
<div style="height: 100px; background: Green; float: left;">fsdfsdf</div>
<div style="float: left">fsdfdsfsdf</div>
</div>
</body>
</html>
Thanks for help!
Why is that? It's really annoying since I have to set a fix height manually on the outer div to get the background color to the height I want.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div style="background: Red;">
<div style="height: 100px; background: Green; float: left;">fsdfsdf</div>
<div style="float: left">fsdfdsfsdf</div>
</div>
</body>
</html>
Thanks for help!