gpt4 book ai didi

图像悬停不起作用 css3

转载 作者:行者123 更新时间:2023-11-28 08:14:36 24 4
gpt4 key购买 nike

问题是当我将鼠标悬停在图像上时没有任何反应。我在我的其他网站上使用了类比代码,一切正常。我不知道是什么问题

这是我的CSS:

   .gallery {
padding-left: 10px;
}
.gallery img {
width: 300px;
height: 205px;
float: left;
margin: 10px 10px;
}
}
.gallery img:hover {
transform: scale(1.2, 1.2);
-webkit-transform: scale(1.2, 1.2);
-moz-transform: scale(1.2, 1.2);
-o-transform: scale(1.2, 1.2);
-ms-transform: scale(1.2, 1.2);
transition: all 0.3s ease;
-webkit-transition: all 0.3s ease;
-moz-transition: all 0.3s ease;
-o-transition: all 0.3s ease;
}
<div class="gallery">
<a target="_blank" href="#">
<img src="images/auto2.png" alt="">
</a>
</div>

最佳答案

你有一个额外的括号

.gallery {
width: 300px;
height: 205px;
margin: 10px 10px;
border: 1px solid red;
overflow: hidden; /* so that the image hide when hovered */
}
.gallery a {
display: block; /* set a to display block */
}
.gallery img {
transition: all 0.3s ease;
-webkit-transition: all 0.3s ease;
-moz-transition: all 0.3s ease;
-o-transition: all 0.3s ease;
}
.gallery:hover img {
transform: scale(1.2, 1.2);
-webkit-transform: scale(1.2, 1.2);
-moz-transform: scale(1.2, 1.2);
-o-transform: scale(1.2, 1.2);
-ms-transform: scale(1.2, 1.2);
}
<div class="gallery">
<a target="_blank" href="#">
<img src="http://placeimg.com/300/205/any" alt="" />
</a>
</div>

关于图像悬停不起作用 css3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29061389/

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