* { box-sizing: border-box; } body { background-color: #663399; display: flex; align-items: center; justify-content: center; margin: 0; min-height: 100vh; } #container { box-shadow: 3px 3px 4px rgba(0, 0, 0, 0.3); height: 500px; width: 500px; overflow: hidden; } img { transform-origin: center center; object-fit: cover; height: 100%; width: 100%; }