Below is the code snippet in question:
#mg1 {
margin-left: 3%;
}
#mg1:hover {
margin-top: 4%;
}
<div id="section1">
<center>
<div id="bgp">
<center>
<p>THUMBNAILS</p>
</center>
</div>
</center>
<br>
<img src="321321321321.png" width="200" height="150" id="mg1">
<img src="ewqfh.png" width="200" height="150" id="mg2">
<img src="2321321.png" width="200" height="150" id="mg3">
</div>
Despite intending for the hover effect to only apply to the image with the id "mg1", it seems to be affecting all images. What could be causing this unexpected behavior?