.card-container { display: grid; flex-wrap: wrap; justify-content: center; } .card { width: 100%; max-width: 300px; display:inline-block; }