body { height: 100vh; display: flex; align-items: center; justify-content: center; } div { width: 100px; height: 100px; display: flex; align-items: center; justify-content: center; margin: 0 10px; } span { width: 50px; height: 50px; } #one, #two { background-color: beige; } #box { background-color: chartreuse; }