body, html { overflow: hidden; margin: 1%; justify-content: center; align-items: center; } #eyes { display: flex; flex-direction: column; justify-content: space-around; float: left; text-align: center; } .grid-container { display: grid; grid-template-columns: 40% 60%; grid-template-rows: 100vh; justify-content: center; align-items: center; } #aphrodite{ max-width: 100%; /* Ensures the image doesn't exceed its container's width */ max-height: 80vh; height: auto; /* Maintains the aspect ratio of the image */ object-fit: contain; justify-content: center; align-items: center; } /* Eye class */ .eye{ display: flex; justify-content: space-around; } .eye ~ a{ text-decoration: none; color: inherit; cursor: pointer; }