$(".img1").mouseenter(function() {
$(this).css('box-shadow', "inset 0 0 20px black");
});
$(".img1").mouseout(function(){
$(this).css('box-shadow', "");
});
$(".img2").mouseenter(function() {
$(this).css('box-shadow', "inset 0 0 20px black");
});
$(".img2").mouseout(function(){
$(this).css('box-shadow', "");
});
$(".h2").mouseenter(function(){
$('.img2').css("box-shadow","inset 0 0 20px black");
});
$(".h2").mouseout(function(){
$('.img2').css("box-shadow", '');
});
$(".h1").mouseenter(function(){
$('.img1').css("box-shadow","inset 0 0 20px black");
});
HTML
<div class="box first">
<div >
<img class="img1" />
</div>
<a href="t1.html"><h3 class="h1"> Aliens </h3></a>
<div>
<p></p>
</div>
</div>
<div class="box second">
<div>
<img class="img2" />
</div>
<a href="a2.html"><h3 class="h2"> Day of the Dead </h3></a>
<p></p>
</div>
<div class="box third">
<div>
<img class="img3" />
</div>
<a href="a3.html"><h3 class="h3"> Evil dead </h3></a>
<p></p>
</div>
How do I make this code shorter to give more images without ever repeating the same. link here is my site, that white border appears around the images, how can I get it out?