【发布时间】:2016-05-10 17:02:57
【问题描述】:
/* CSS used here will be applied after bootstrap.css */
body{
background-color:yellow;
}
img{
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
-ms-transition: all 0.5s ease;
transition: all 0.5s ease;
}
img:hover{
-webkit-filter:blur(5px);
}
<img src="http://i.stack.imgur.com/K0jNI.png">
当您将鼠标悬停在图像上时,图像的边框会在稳定之前闪烁一会儿。有没有办法解决这个问题?
当我将鼠标悬停在图像中间时,如何让文字显示在图像中间?
【问题讨论】:
-
是的,它在 Chrome 中看起来“不稳定”。奇怪的。不过在Mozilla中完全没问题,至少如果你在
-webkit-filter之后添加filter...无论如何,要使文本出现,请在过滤器后的范围内添加文本,绝对定位,使用@使其不可见987654325@ 并使用img:hover + span选择器来显示它。 -
如何让它在 Firefox 中工作?我刚刚在 Firefox 中尝试了我的代码,但它甚至都不起作用大声笑
标签: html css css-transitions css-filters