html - 在翻转 css 动画期间更改图像

标签 html css animation css-animations

我目前有一个旋转图像,可以翻转并使用动画 css 在背面写字,但是我想要的是,当图像翻转时,它会随着另一个图像发生变化,因此它具有纯色而不是反转版本图片。

CSS

.hover-img {
position: relative;
width: 400px;
height: 300px;
-webkit-transition: all 1s ease-in-out;
-moz-transition: all 1s ease-in-out;
-ms-transition: all 1s ease-in-out;
-o-transition: all 1s ease-in-out;
transition: all 1s ease-in-out;
background:url(bbclike/topright.png);
-webkit-transform:rotateY(180deg);
-webkit-transform-style: preserve-3d;
    line-height:200px;
text-align:center;
font-size:0;

}
.hover-img:hover{
-webkit-transform:rotateY(0deg);
font-size:14px;
color:white;
background-color:#FF0;

}

HTML

<div class="hover-img">
Text Goes Here
</div>

最佳答案

当用户将鼠标悬停在 div 上时,只需将你想要的任何内容放入悬停部分...例如:

.hover-img:hover{
background:url(---HERE IMAGE 2---);
font-size:14px;
color:white;
background-color:#FF0;
}

工作 fiddle 演示 here

关于html - 在翻转 css 动画期间更改图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24828019/

相关文章:

python - 阻止 gif 图像在 matplotlib 中重复

html - 未应用新制作的 CSS 类

javascript - 如何从输入类型 'X' 控件中删除 ="text/search"

javascript - 在 div 中显示所有结果

javascript - 如何使用 css 在 3 列中显示元素

html - IE8 和 IE7 CSS 与 div 和定位的问题

html - Bootstrap 中的 float div

html - 如何分离 <p> 元素内的 <a> 元素

c# - 从动画完成事件中获取 UIElement

html - 如何使用CSS制作水平滑动无限动画?