I'm trying to create an effect where there are multiple vertical portions of images side-by-side, and as you hover over an image that container grows while the other containers shrink to "reveal" the full image. I want the only scaling of the image to be that it fits in a browser window when it is fully "revealed".
Here is a snip of this effect without any images:
* {
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
}
.row {
flex-basis: 0;
display: flex;
flex-direction: row;
}
.column {
flex-grow: 1;
border: 2px solid #000;
transition: all 300ms ease-in-out;
}
.column:hover {
flex-grow: 4.3;
}
<div class="row">
<div class="column">
</div>
<div class="column">
</div>
<div class="column">
</div>
</div>
But now, if I leave everything the same and simply add img tags within the "column" divs, any shrinking or growing ceases completely.
* {
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
}
.row {
flex-basis: 0;
display: flex;
flex-direction: row;
}
.column {
flex-grow: 1;
border: 2px solid #000;
transition: all 300ms ease-in-out;
}
.column:hover {
flex-grow: 4.3;
}
<div class="row">
<div class="column">
<img src="https://images.pexels.com/photos/2194261/pexels-photo-2194261.jpeg" />
</div>
<div class="column">
<img src="https://images.pexels.com/photos/1276553/pexels-photo-1276553.jpeg" />
</div>
<div class="column">
<img src="https://images.pexels.com/photos/774731/pexels-photo-774731.jpeg" />
</div>
</div>
I am new to CSS so I'm sure I'm just unfamiliar with some obvious concept about flexbox but all my google searches have been in vain. Any answers, directions, or learning site recommendations would be greatly appreciated.