I am trying to create several evenly spaced columns ( ol), with the columns themselves being a fixed width.
So far, I have managed to achieve the desired effect using the layout tableand a nested additional element inside the list item.
HTML:
<ol>
<li><div></div></li>
<li><div></div></li>
<li><div></div></li>
<li><div></div></li>
<li><div></div></li>
</ol>
CSS
ol {
display: table;
width: 100%;
}
li {
display: table-cell;
}
div {
margin: 0 auto;
width: 100px;
height: 250px;
}
This one works fine , but has the following two drawbacks:
- As you can see in the demo , the first and last columns do not line up with the original outer edges.
- This cannot be really used. The only thing you can do with smaller widths is to drain them , but I would like to split them (2 or 3 per line).
, CSS? , JS, CSS-.
P.S. IE7, IE8. CSS3 , selectivizr ( , JS; -)).