In my project, I have a background video that always scales to cover 100% of the screen (even if the sides are clipped). However, in the video there are a few points of interest and what I'm trying to do is position divs on top of each of these areas so that I can detect and handle hover events. However, after many tries, I'm not able to make the divs stick to that one location even as the window gets resized. Is there any way to do this? I know the aspect ratio of the video.
Any help is appreciated!
EDIT:
I made a sample project on jsfiddle to show what I'm trying to do. I would like the blue div box to always stay directly on the peak of the mountain in the image. Even as the image changes size, the div should stay on top of it.
Here's the following code.
.son1 {
width: 20px;
height: 20px;
background: blue;
position: absolute;
padding: 10px;
left: 100px;
top: 160px;
}
img {
height: 100vh;
width: 100%;
object-fit: cover;
position: absolute;
border-style: solid;
}
<html>
<head>
<title>Check this</title>
</head>
<body>
<div>
<img src="https://images.all-free-download.com/images/graphiclarge/evening_landscape_210502.jpg">
<div class="son1"></div>
</div>
</body>
</html>