I have a layout with 4 columns of images that I want to scale on mouse hover using the 'column-count' property.
The first column works correctly, but the next three end up positioned under the upper border during the transformation.
I've experimented with different margins and padding values, as well as tried using 'z-index', but nothing seems to work.
Check out the live example on JSFiddle
Here is the code snippet:
.content{
margin-top: 20px;
background-color: black;
}
.photos img {
margin-bottom: 10px;
vertical-align: middle;
height: auto;
width: 100%;
}
.photos {
-webkit-column-count: 4;
-moz-column-count: 4;
column-count: 4;
-webkit-column-gap: 10px;
-moz-column-gap: 10px;
column-gap: 10px;
}
li img {
-webkit-transition: 0.2s;
}
li img:hover {
-webkit-transition: .5s;
transform: scale(1.3);
}
<div class="content">
<ul class="photos">
<li>
<img src="https://syndlab.com/files/view/5db9b150252346nbDR1gKP3OYNuwBhXsHJerdToc5I0SMLfk7qlv951730.jpeg">
</li>
<li>
<img src="https://lh3.googleusercontent.com/proxy/t2UjB23Xy8xLCPcwavD_5pqDWQH8wx1tOggm85KZq22oyODukZGZyMDIfGHwIKyZj1U4JeAzn3t5bkgPXcV8pJ60udJ1eQ">
</li>
<li>
<img src="https://images.all-free-download.com/images/graphicthumb/bavarian_landscape_515460.jpg">
</li>
<li>
<img src="https://cdn-ep19.pressidium.com/wp-content/uploads/2019/08/16-9-original-1.jpg">
</li>
</ul>
</div>