我正在尝试使用CSS过渡效果制作“淡入淡出”效果。但是我无法在背景图片上实现这个效果...
CSS代码:
.title a {
display: block;
width: 340px;
height: 338px;
color: black;
background: transparent;
/* TRANSITION */
-webkit-transition: background 1s;
-moz-transition: background 1s;
-o-transition: background 1s;
transition: background 1s;
}
.title a:hover {
background: transparent;
background: url(https://lh3.googleusercontent.com/-p1nr1fkWKUo/T0zUp5CLO3I/AAAAAAAAAWg/jDiQ0cUBuKA/s800/red-pattern.png) repeat;
/* TRANSITION */
-webkit-transition: background 1s;
-moz-transition: background 1s;
-o-transition: background 1s;
transition: background 1s;
}
background-image
不是可动画化的属性(http://www.w3.org/TR/css3-transitions/#animatable-properties),因此你的解决方案不符合标准。 - TLindigbackground
,应该使用它(在我的Chrome中可以工作)。也许规范(或实现)在问题发布后有所更改。 - fps