【发布时间】:2018-06-20 16:06:04
【问题描述】:
我有一堆社交媒体按钮,我给了它们一个小的变换和缩放效果。问题是它们在悬停时都会同时变形。
当鼠标悬停在每个单独的按钮上而不是一次全部激活时,如何使这个转换效果激活?
这是我的 HTML:
<div id="social">
<a href="https://www.facebook.com/ionut.andrei.92" target="_blank"><img src="img/icons/facebook.svg" alt="Facebook"></a>
<a href="https://vk.com/id362685172" target="_blank"><img src="img/icons/vk.svg" alt="VKontakte"></a>
<a href="https://www.instagram.com/ioan_andrei93/" target="_blank"><img src="img/icons/instagram.svg" alt="Instagram"></a>
<a href="https://twitter.com/IoanAndrei11" target="_blank"><img src="img/icons/twitter.svg" alt="Twitter"></a>
</div>
</div>
这是我的 CSS:
#social img{
width: 55px;
height: 55px;
position: relative;
left: 1100px;
top: -50px;
#social:hover img{
transform: scale(1.25);
transition: transform .25s ease;
【问题讨论】:
-
只需将鼠标悬停在其中的每一个上,而不是全部悬停... [阅读您为悬停编写的选择器,您就会明白]
标签: css button transform media social