.donorsList { list-style: none; font-family: sans-serif; margin: 0; padding: 0; /* display: flex; flex-wrap: wrap; */ justify-content: center; display: grid; grid-row-gap: 1rem; } @media screen and (min-width: 448px) { .donorsList { grid-template-columns: repeat(2, 200px); grid-column-gap: 20px; } .donorsList > li:nth-of-type(2n+1) { grid-column: 1; } .donorsList > li:nth-of-type(2n+2) { grid-column: 2; } } @media screen and (min-width: 672px) { .donorsList { grid-template-columns: repeat(3, 204px); grid-column-gap: 20px; } .donorsList > li:nth-of-type(3n+1) { grid-column: 1; } .donorsList > li:nth-of-type(3n+2) { grid-column: 2; } .donorsList > li:nth-of-type(3n+3) { grid-column: 3; } } @media screen and (min-width: 896px) { .donorsList { grid-template-columns: repeat(4, 204px); grid-column-gap: 20px; } .donorsList > li:nth-of-type(4n+1) { grid-column: 1; } .donorsList > li:nth-of-type(4n+2) { grid-column: 2; } .donorsList > li:nth-of-type(4n+3) { grid-column: 3; } .donorsList > li:nth-of-type(4n+4) { grid-column: 4; } } @media screen and (min-width: 1120px) { .donorsList { grid-template-columns: repeat(5, 204px); grid-column-gap: 20px; } .donorsList > li:nth-of-type(5n+1) { grid-column: 1; } .donorsList > li:nth-of-type(5n+2) { grid-column: 2; } .donorsList > li:nth-of-type(5n+3) { grid-column: 3; } .donorsList > li:nth-of-type(5n+4) { grid-column: 4; } .donorsList > li:nth-of-type(5n+5) { grid-column: 5; } } @media screen and (min-width: 1344px) { .donorsList { grid-template-columns: repeat(6, 204px); grid-column-gap: 20px; } .donorsList > li:nth-of-type(6n+1) { grid-column: 1; } .donorsList > li:nth-of-type(6n+2) { grid-column: 2; } .donorsList > li:nth-of-type(6n+3) { grid-column: 3; } .donorsList > li:nth-of-type(6n+4) { grid-column: 4; } .donorsList > li:nth-of-type(6n+5) { grid-column: 5; } .donorsList > li:nth-of-type(6n) { grid-column: 6; } } .donorsList li { /* flex-basis: var(--base-width); flex-grow: 0; display: flex; align-items: center; */ background-color: white; overflow: hidden; border: 2px solid hsl(0, 0%, 90%); box-shadow: -1px 1px 10px hsla(0, 0%, 0%, 0.2); margin: 0; text-align: center; border-radius: 1em; } .donorsList li a { width: 100%; color: hsl(0, 0%, 10%); text-decoration: none; font-size: 0.9em; } .donorsList li a img { background-color: #1a237e; width: 100%; } .donorsList li a img, .donorsList li a .name { width: 100%; } .donorsList li a .name { display: block; padding: 1rem 0; font-weight: bold; text-align: center; } .donorsList li a .name span { display: inline-block; padding: 0 1em; text-align: left; }