对于背景图像标签和实际的<img>
标签,我都遇到了这个问题-当我反复悬停时,图像会随着跳跃和闪烁而过渡。我假设新的计算可能基于其当前状态值。如何防止这种行为?
body{
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
img {
display: block;
max-width: 70vw;
max-height: 70vh;
transition: transform .4s;
}
img:hover{
transform: perspective(300px) scale(1.05) translateZ(-10px) rotateY(-2deg);
}
<img src="https://picsum.photos/700/600">