我试图在鼠标悬停时使用 css 在缩略图上进行转换,以便在悬停时背景渐变淡入。转换不起作用,但如果我只是将其更改为 rgba()值,它工作正常。不支持渐变吗?我也尝试过使用图像,它也不会转换图像。
我知道这是可能的,因为在另一篇文章中有人做到了,但我不知道到底是怎么做到的。任何帮助> 这是一些可以使用的 CSS:
#container div a {
-webkit-transition: background 0.2s linear;
-moz-transition: background 0.2s linear;
-o-transition: background 0.2s linear;
transition: background 0.2s linear;
position: absolute;
width: 200px;
height: 150px;
border: 1px #000 solid;
margin: 30px;
z-index: 2
}
#container div a:hover {
background: -webkit-gradient(radial, 100 75, 100, 100 75, 0, from(rgba(0, 0, 0, .7)), to(rgba(0, 0, 0, .4)))
}
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号