我试图在悬停时使图像褪色,而在不悬停时则正常。当我把我的代码放在一个小的html文件中时,一切似乎都运行正常。但是当我将我的代码插入到wordpress网站时,使用Black Studio Tiny MCE插件,只有渐渐消失似乎有效。有人可能知道如何解决这个问题吗? 谢谢,
学家
#test_menu {
opacity: 0.6;
transition: opacity 1s ease-in-out;
-moz-transition: opacity 1s ease-in-out;
-webkit-transition: opacity 1s ease-in-out;
}
#test_menu:hover {
opacity: 1.0;
transition: opacity .55s ease-in-out;
-moz-transition: opacity .55s ease-in-out;
-webkit-transition: opacity .55s ease-in-out;
}

<div style="position:relative;width:496.5px;height:124.125px;">
<a href="https://epowerhr.be/hr-software-oplossing-talent/ehrm-performance-management-software/">
<img id="test_menu" src="https://epowerhr.be/wp-content/uploads/2014/10/shutterstock_190964189.jpg" style="position:absolute;left:0;top:0;" />
<p style="z-index:100;position:absolute;color:black;font-size:24px;font-weight:bold;left:50px;top:50px;">
Performance management
</p></a>
</div>
&#13;
答案 0 :(得分:0)
这样的东西?
img, img:hover {-webkit-transition: all 0.5s ease; -o-transition: all 0.5s ease; transition: all 0.5s ease;}
img:hover {opacity: 0;}
<img src="http://placehold.it/350x150" />