One of the challenges with the parent container is fitting an image inside it:
.parent {
position: relative;
text-align: center;
overflow: hidden;
display: flex;
align-items: center;
align-content: center;
justify-content: center;
transform-origin: center;
height: inherit;
cursor: move;
}
.wrapper {
width: 680px;
height: 500px;
overflow: hidden;
}
<div class="wrapper">
<div class="parent">
<img class="image" src="">
</div>
</div>
In cases where the loaded image has a height exceeding 500px, there might be an overflow issue. How do we automatically fit and scale the image within the .parent
block?