@media (min-width: 40em) { main { width: 80%; justify-self: center; } main #photos { display: grid; grid-template-columns: repeat(4, auto); justify-content: space-around; width: 100%; } #photos > * { height: 100%; } #photos img.portrait { height: 60vh; filter: grayscale(0.5); transition: filter 1s, transform 1s; } #photos img.portrait:hover { filter: none; transform: scale(1.05); } } @media (max-width: 40em) { #photos { display: grid; grid-template-columns: repeat(4, 20%); justify-content: space-evenly; width: 100%; } #photos > * { width: 100%; height: 50vh; } #photos img.portrait { width: 100%; height: 100%; object-fit: cover; object-position: center; } }