gpt4 book ai didi

html - CSS3 缩放动画重置

转载 作者:太空宇宙 更新时间:2023-11-04 16:17:29 28 4
gpt4 key购买 nike

CSS3 过渡会立即重置,即使我仍在悬停它。当鼠标悬停在它上面时,任何人都可以帮助我使它永久化而不是重置吗?

.grow {
-webkit-transition: all .2s ease-in-out;
}
.grow:hover {
-webkit-transform: scale(1.1);
}
<a class="logo-icon grow" href="#">
<img src="http://static.guim.co.uk/sys-images/Guardian/Pix/pictures/2014/4/11/1397210130748/Spring-Lamb.-Image-shot-2-011.jpg" alt="logo">
</a>

最佳答案

你的链接搞砸了,因为它是 display: inline

.grow { 
-webkit-transition: all .2s ease-in-out;
display: block; /* or display: inline-block; */
}

.grow:hover {
-webkit-transform: scale(1.1);
}
<a class="logo-icon grow" href="#">
<img src="http://static.guim.co.uk/sys-images/Guardian/Pix/pictures/2014/4/11/1397210130748/Spring-Lamb.-Image-shot-2-011.jpg" alt="logo">
</a>

但为什么呢?

内联元素不会扩展到其内容的高度。 block 元素做: enter image description here

关于html - CSS3 缩放动画重置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31214019/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com