.photo-row { padding:0.2em 0; display:flex; } .photo-row:first-child { padding-top:0; } .photo-row:last-child { padding-bottom:0; } .image-container { cursor:pointer; padding:0 0.2em; flex-grow:1; } .image-container:first-child { padding-left:0; } .image-container:last-child { padding-right:0; } .image { width:100%; height:100%; display:block; object-fit:cover; /* technically not needed, but helps when browsers glitch */ }