I must be doing something really dumb here but I just can't see it and I get the same symptoms in both Firefox & IE7. I want the width of the containing div (light blue box) to automatically grow according to the space occupied by the divs (darker blue) within it. But it expands to the width of the window.
Please put me out of my misery:
Please put me out of my misery:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/html4/loose.dtd">[/URL]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<style type="text/css">
div.TableBlock { height:auto; width:auto; background-color:rgb(112,187,244);
margin:3px; font-size:8pt; float:left;
border: 1px solid black; padding-bottom:5px; }
</style>
<title>Problem</title>
</head>
<body>
<div style="width:auto; border:solid 1px black; background-color:rgb(188,221,221); height:auto; padding:5px; overflow:auto">
<div class="TableBlock">
<p><b>Section 1</b></p>
</div>
<div class="TableBlock">
<p><b>Section 2</b></p>
</div>
<div class="TableBlock">
<p><b>Section 3</b></p>
</div>
<div class="TableBlock">
<p><b>Section 4</b></p>
</div>
<div class="TableBlock">
<p><b>Section 5</b></p>
</div>
<div class="TableBlock">
<p><b>Section 6</b></p>
</div>
</div>
</body>
</html>