【发布时间】:2015-05-30 11:43:21
【问题描述】:
欢迎。 我正在尝试在悬停时在背景图像上添加颜色并持续一段时间。我已经添加了颜色蒙版,但是动画时间有问题。谁能告诉我为什么 transition-duration 在这里不起作用?
小提琴:https://jsfiddle.net/kamilm14/pysmzryn/
这是我的 HTLM 代码:
<table style="width: 510px; border: 0px;">
<tr>
<td class="scandic">
</td>
<td style="width: 10px; height: 119px;">
</td>
<td class="stayinn">
</td>
</tr>
</table>
还有 CSS:
.scandic {
width: 250px; height: 119px;
background: url('http://oi61.tinypic.com/2dvlibt.jpg') no-repeat;
background-size: 250px 119px;
border: 0;
}
.scandic:hover {
background: linear-gradient(0deg, rgba(0,188,212,0.8), rgba(0,188,212,0.8)), url(http://oi61.tinypic.com/2dvlibt.jpg) no-repeat;
background-size:250px 119px;
}
.stayinn {
width: 250px; height: 119px;
background-image: url('http://oi58.tinypic.com/35iztsh.jpg');
background-repeat:no-repeat;background-size:250px 119px;
border: 0;
}
.stayinn:hover {
background: linear-gradient(0deg, rgba(0,188,212,0.8), rgba(0,188,212,0.8)), url(http://oi58.tinypic.com/35iztsh.jpg) no-repeat;
background-size:250px 119px;
}
.scandic, .stayinn {
-webkit-transition-duration: 2s;
-moz-transition-duration: 2s;
-o-transition-duration: 2s;
transition-duration: 2s;
}
【问题讨论】:
标签: html css background transition duration