gallery with thumbnails:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hover Gallery</title>
<style>
body{
margin:0;
display:flex;
justify-content:center;
align-items:center;
height:100vh;
background:#111;
font-family:Arial;
}
.gallery{
width:600px;
text-align:center;
}
.main{
width:100%;
height:350px;
border-radius:10px;
background-size:cover;
background-position:center;
margin-bottom:15px;
}
.thumbs{
display:flex;
gap:10px;
justify-content:center;
}
.thumbs img{
width:90px;
height:60px;
border-radius:8px;
cursor:pointer;
transition:0.25s;
object-fit:cover;
}
.thumbs img:hover{
transform:scale(1.25);
}
</style>
</head>
<body>
<div class="gallery">
<div class="main" id="main"></div>
<div class="thumbs">
<img src="https://picsum.photos/id/1015/300/200">
<img src="https://picsum.photos/id/1025/300/200">
<img src="https://picsum.photos/id/1035/300/200">
<img src="https://picsum.photos/id/1043/300/200">
</div>
</div>
<script>
const main=document.getElementById("main");
document.querySelectorAll(".thumbs img").forEach(t=>{
t.addEventListener("mouseover",()=>main.style.backgroundImage=`url(${t.src})`);
});
main.style.backgroundImage=`url(${document.querySelector(".thumbs img").src})`;
</script>
</body>
</html>