I wanted to create a hover effect where the image would enlarge when hovered over. I achieved this using a JavaScript function that applies the transform property with a scale of 1.2 to the picture. However, during the animation, a black line appears at the bottom of the image, even though it's not related to the image itself. The href attribute contains a link to a locally saved image, so I replaced it with # for the code to work properly. Click here to view the image.
function actionWhenMouseOver(imgName) {
var img = document.getElementById(imgName);
img.style['transform'] = "scale(1.2)";
img.style['transition'] = "0.3s";
}
function actionWhenMouseOut(imgName) {
var img = document.getElementById(imgName);
img.style['transform'] = "scale(1)";
img.style['transition'] = "0.3s";
}
<div class="col-md-12 col-lg-6 text-center mb-3">
<img src="#" alt="" class="block" id="block2" onmouseover="actionWhenMouseOver(this.id)" onmouseout="actionWhenMouseOut(this.id)">
</div>