Update: What should I do if the width size is unknown?
Check out the demo on JS Fiddle
If you visit the provided link, I am trying to achieve a zoom effect where only the image inside the div zooms, not the entire div itself. However, I seem to be missing something. Can anyone offer some guidance?
.img-container {
position: relative;
overflow: hidden;
margin:0;
padding:0;
height: 100px !important;
}
.img-container img{
height: 100px;
-moz-transition:all .8s;-webkit-transition:all .8s;transition:all .8s
}
.img-container:hover img{
max-width:100%
-moz-transform: scale(1.4);
-webkit-transform: scale(1.4);
transform: scale(1.4);
}
<div class="container">
<div class="row">
<div class="col-sm-4">
<div class="img-container">
<img src="http://www.macforensicslab.com/images/icon_GoogleSearch.jpg"/>
</div>
</div>
<div class="col-sm-4">
<div class="img-container">
<img src="http://www.macforensicslab.com/images/icon_GoogleSearch.jpg"/>
</div>
</div>
<div class="col-sm-4">
<div class="img-container">
<img src="http://www.macforensicslab.com/images/icon_GoogleSearch.jpg"/>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<div class="img-container">
<img src="http://www.macforensicslab.com/images/icon_GoogleSearch.jpg"/>
</div>
</div>
</div>
</div>