.image-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 40px; padding: 20px; } .image-item { width: 100%; height: 0; padding-bottom: 80%; /* 540px / 675px = 0.8 = 80% */ position: relative; } .image-item img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; object-position: center center; border-radius: 5px; box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); }