Hello stocktrader,
To make multicolumn lists is easy, you just have to float the li's. The problem comes when you want it ordered like your example. If the input is in order like 1,2,3,4 then floating those li's makes it look like this:
1 2
3 4
5 6
See this example:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
html, body {
margin: 0;
background: #fc6;
}
#container {
width: 800px;
margin: 30px auto;
padding: 50px 0 450px;
background: #fff;
box-shadow: 0 0 20px #8493A6;
overflow: auto;
}
ul {
width: 100px;
margin: 0 auto;
padding: 0;
list-style: none;
}
li {
width: 50px;
float: left;
}
</style>
</head>
<body>
<div id="container">
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
<li>7</li>
<li>8</li>
<li>9</li>
<li>10</li>
</ul>
<!--end container--></div>
</body>
</html>
Your example code on jsFiddle is a little messed up. There is no such thing as
float: top; so that may be one reason it's not acting like you want. Another problem is specifying a height, it's usually best to let a container expand to contain it's contents rather than limit it to a set height.
Look at some
examples I have of lists here.