h1 { text-align: center; } section { margin: 40px; } .box { width: 100px; height: 100px; } .is-1 { background-color: red; } .is-2 { background-color: blue; } .is-3 { background-color: green; } .grid { display: grid; grid-template-columns: repeat(auto-fit, 100px); justify-content: center; grid-gap:1em; }