html - 悬停期间的淡入淡出效果 - border-radius 不起作用

标签 html css hover fade

看看这个jFiddle与 Chrome 。 谁能帮我解决这个问题?我不想在过渡期间看到图像的 Angular 落。 如果可能的话,我更喜欢不用 jQuery :) 谢谢!

CSS

#cf {
  position:relative;
  height:300px;
  width:300px;
  margin:0 auto;  
  border-radius:50%; 
   overflow:hidden;
    border: 10px solid red;
}

#cf img {
  position:absolute;
  left:0;
  -webkit-transition: opacity 1s ease-in-out;
  -moz-transition: opacity 1s ease-in-out;
  -o-transition: opacity 1s ease-in-out;
  transition: opacity 1s ease-in-out;
}

#cf img.top:hover {
  opacity:0;
}

HTML

<div id="cf">
  <img class="bottom" src="http://www.world-science.org/wp-content/uploads/2011/07/Lion_300.jpg" />
  <img class="top" src="http://bioexpedition.com/wp-content/uploads/2012/06/Sea-Turtle-Anatomy.jpg" />
</div>

jFiddle

最佳答案

在我看来,这像是 Chrome 中的一个错误。

您可以通过 setting the same border-radius on the image 解决它.

#cf img {
  border-radius:50%; 
  overflow:hidden;
}

关于html - 悬停期间的淡入淡出效果 - border-radius 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20326719/

相关文章:

javascript - 使用 Angular 在悬停时同时更改多个元素组的样式

css - 如何使悬停效果不适用于 :before pseudo selector?

javascript - 在后台向图表添加图像

jquery - 垂直居中内容 jQuery 和 FireFox

css - Foundation,如何设置像onclick这样的按钮?

javascript - 如何使用 JavaScript 制作动画?

javascript - 悬停在另一个 div 上时触发悬停效果

javascript - 如何增加信息覆盖的高度

php - 使用 session 变量从 2 个表中进行选择

performance - 构建 HTML5 移动应用程序的推荐方法是什么?