I'm not sure why you intend to move the img
when all of your transform
and transition
properties are on .move-left
.
I've fixed your HTML as well as per @Paulie_D's comment.
.move-left {
position: relative;
transition: transform 0.3s ease;
transform: translateX(0px);
}
ul {
list-style: none;
}
.move-left:hover {
transform: translateY(-4px);
cursor: pointer;
}
<div class="move-left">
<ul>
<li class="nav-item">
<a href="#"><img src="https://www.svgrepo.com/show/3885/facebook.svg" height="16px"></a>
</li>
</ul>
</div>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…