/* html */
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
</ul>
/* CSS */
ul>li {
width: 100px;
height: 100px;
display: inline-block;
}
<!DOCTYPE html>
<html>
<head>
<style>
div {
display: inline-block;
}
div>div {
display: inline-block;
width: 100px;
height: 100px;
background: #ccc;
}
</style>
</head>
<body>
<div>
<div>1</div>
<div>2</div>
</div>
<div>
<div>3</div>
<div>4</div>
</div>
<div>
<div>5</div>
<div>6</div>
</div>
<div>
<div>7</div>
<div>8</div>
</div>
<div>
<div>9</div>
<div>10</div>
</div>
<div>
<div>11</div>
<div>12</div>
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
* { margin: 0; padding: 0; }
ul { list-style: none; text-align: center; }
ul>li {
float: left;
width: 100px;
height: 100px;
background: #000;
}
ul>li:nth-child(odd) {
margin-right: 100px;
background: #999;
}
ul>li:nth-child(even) {
margin-left: -100px;
background: #eee;
}
</style>
</head>
<body>
<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>
</body>
</html>