我的CSS和HTML代码是这样的:
.item-video-kami {
width: 480px;
overflow: hidden;
position: relative;
}
.item-video-kami>.play-icon.full-height>svg {
width: 106px;
color: #ffffff50;
}
.item-video-kami img {
transition: all .5s ease;
}
.item-video-kami>.play-icon {
height: 100%;
position: absolute;
display: flex;
width: 100%;
justify-content: center;
align-items: center;
background-color: #1e1e1e94;
opacity: 0;
/* Initial opacity set to 0 */
transition: opacity 0.2s ease-in 0.1s;
}
.item-video-kami:hover img {
transform: scale(1.1);
}
.item-video-kami:hover .play-icon {
opacity: 0.8;
/* Adjusted opacity value to 0.8 for 80% */
}
个字符
预期的结果是,当光标悬停在.item-video-甲米上方时,图像将缩放(按比例放大),同时,div. play图标将不透明度更改为0.8
但是在上面的片段中,动画只用于放大图像,但第二个动画不是触发器(如果不清楚,请检查片段)
1条答案
按热度按时间d5vmydt91#
这是预期的输出吗?
个字符