If I am using a transform scale is there a way to keep the object fit image using cover from stretching? Here is my code
div.category {
width: 80%;
height: 150px;
margin: 20px;
position: relative;
overflow: hidden;
}
img {
width: 100%;
transition: transform 0.35s;
object-fit:cover;
}
div.category:hover {
transform:scalex(1.2)
}
html
<div>
<div class="category">
<img src="http://www.4freephotos.com/images/batch/Elephant-dusting674.jpg" />
</div>
<div class="category">
<img src="http://www.4freephotos.com/images/batch/Bananas-and-kiwi-221.jpg" />
</div>
<div class="category">
<img src="http://placehold.it/1200x950&text=1200x950+-+Category+3+-" />
</div>
</div>
Here is a fiddle explaining what I mean:
I would love if the image just scaled up to fit the new div width without distorting.
Consider a different animation. Here is an idea using
clip-path