I am trying to learn how to make a simple website in HTML. Currently I have created a background image that image has multiple shapes on it. I want different parts of the image to be clickable links. I understand how to find the coordinates and use an image map however the clickable links are not working when I change the screen size. How can I make the clickable areas work for different screen sizes?
body, html {
height: 100%;
margin: 0;
}
.bg {
background-position: left;
background-repeat: no-repeat;
background-size: 100% 100%;
}
<div class="bg"></div>
<body>
<img src="https://cdn.pixabay.com/photo/2018/01/24/18/05/background-3104413_1280.jpg" width="100%" height="100%" usemap="workmap" class="bg">
<map name="workmap">
<area target="_blank" alt="Game1" title="Game1" href="game1.html" coords="243,133,79" shape="circle">
<area target="_blank" alt="Game2" title="Game2" href="game2.html" coords="870,147,680,33" shape="rect">
<area target="_blank" alt="Game3" title="Game3" href="game3.html" coords="889,379,80" shape="circle">
<area target="_blank" alt="CS" title="CS" href="https://code.org/educate/csp " coords="770,671,73" shape="circle">
<area target="_blank" alt="Game4" title="Game4" href="game4.html" coords="163,587,214,492,267,473,335,483,377,603,327,631,249,658,211,641" shape="poly">
</map>
Thank you!