【发布时间】:2017-12-06 02:58:36
【问题描述】:
悬停时,我无法让背景在悬停时从 0 不透明度过渡到 0.6。 这是我的 CSS:
.work--overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: radial-gradient( rgba(64,56,43,0), rgba(0,0,0,0), rgba(0,0,0,0));
opacity: 1;
z-index: 1;
transition: background 0.3s ease-in-out;
}
.work--overlay:hover {
background: radial-gradient( rgba(64,56,43,0.6), rgba(0,0,0,0.6), rgba(0,0,0,0.6));
transition: background 0.3s ease-in-out;
}
我还应该提到,效果确实适用于悬停,只是过渡缓动部分不起作用。所以我 99% 确定这是 CSS 的东西。
【问题讨论】:
-
@ObsidianAge :// 拍得好
标签: css hover css-transitions