.flex-container { display: flex; flex-wrap: wrap; } .flex-container > div { background-repeat: no-repeat; background-position: center center; background-size: cover; width: 33.33%; height: 200px; } .flex-container > div:nth-child(3n+1) { margin-left: 0; } .flex-container > div:nth-child(1) { background-image: url("images/puzzle3/1.png"); } .flex-container > div:nth-child(2) { background-image: url("images/puzzle3/2.png"); } .flex-container > div:nth-child(3) { background-image: url("images/puzzle3/faulty.png"); display: none; } .flex-container > div:nth-child(4) { background-image: url("images/puzzle3/4.png"); } .flex-container > div:nth-child(5) { background-image: url("images/puzzle3/5.png"); } .flex-container > div:nth-child(6) { background-image: url("images/puzzle3/6.png"); }