I have multiple floating div tags and I want to have them stack on top of each other from left to right so that they look like text in a newspaper. The difficulty is that if I float the divs then they go from left to right and if I don’t do this then they simply stack on top of each other. Is there a way to get them to stack evenly from left to right?
<div>
<br />
<br />
<style type="text/css">
.mainpanel
{
display: block;
border-left-width: 1px;
border-left-color: Black;
border-left-style: double;
padding: 3px;
float: left;
}
</style>
<div style="" class="mainpanel">
<div style="width: 245px; float: left; padding: 5px;">
1
</div>
<div style="width: 245px; float: left; padding: 5px;">
2
</div>
<div style="width: 245px; float: left; padding: 5px;">
3
</div>
<div style="width: 245px; float: left; padding: 5px;">
4
</div>
<div style="width: 245px; float: left; padding: 5px;">
5
</div>
<div style="width: 245px; float: left; padding: 5px;">
6
</div>
<div style="width: 245px; float: left; padding: 5px;">
7
</div>
<div style="width: 245px; float: left; padding: 5px;">
8
</div>
<div style="width: 245px; float: left; padding: 5px;">
9
</div>
</div>
</div>