Otra forma más semántica pero menos compatible con pseudonavegadores
Código HTML:
Ver original<!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" xml:lang="es" lang="es-es"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" /> * {margin:0; padding:0; position: relative;}
html, body {
height: 100%;
font-family: garamond, serif;
font-size: 100%;
}
#contenedor {
background: #fe0 url(serv/css/estilos/reticula.gif) repeat;
width: 900px;
margin: 0 auto;
overflow: hidden;
}
#contenedor > div {
width:140px;
height: 105px;
background: #cacaca;
float: left;
margin: 10px;
}
#contenedor > div:nth-child(3n) {
float:right;
}
#contenedor > div:nth-child(3n-1) {
margin-left: 220px;
margin-right: 220px;
}
Y si de centrar múltiples elementos (desconocido su número a priori) se trata, sin necesidad de crear cajas innecesarias sería con el uso de text-align: center; y letter-spacing (para separar los hijos lateralmente) en el contenedor padre y a los div´s hijos declararlos como elementos de línea.
Inieva: buena ocurrencia el crear la segunda caja de tamaño mayor.