I am trying to put two images next to each other using
span.img {
position: absolute;
margin-left: 100px;
transition: margin 0.5s;
height: 150px;
width: 150px;
}
span.img:hover {
margin-left: 0px;
}
span.image {
margin-left: 350px;
transition: margin 0.5s;
height: 150px;
width: 150px;
}
span.image:hover {
margin-left: 450px;
}
<span>
<img src="http://placehold.it/200/FF6347/FFF" />
</span>
<span>
<img src="http://placehold.it/200/47E3FF/000" />
</span>
Run codeHide resultand I want to move it to the left on hover (by going to css), but the problem is when I try to do this, the image on the right side will also move.
How can I make the image of the right side not move when another image is moving?
Milad source
share