.container { display:flex; justify-content:center; } .container>div { width:100px; height:100px; border:1px solid gray; margin:0 10px; } .red { background-color:red; } .orange { background-color:orange; } .yellowgreen { background-color:yellowgreen; } body { text-align:center; } input { margin:10px 5px; }