最佳答案
也通过向 img 添加 border-radius 解决了这个问题。不确定那是否是您想要的。请评论这是否重要!
a {
width: 100px;
height: 100px;
background: #000;
display: block;
border: 2px solid #000;
border-radius: 50%;
overflow: hidden;
}
img {
max-width: 100%;
-webkit-transition: opacity 0.1s linear;
-moz-transition: opacity 0.1s linear;
-o-transition: opacity 0.1s linear;
transition: opacity 0.1s linear;
border-radius: 50%;
}
img:hover {
opacity: 0.5;
}
关于CSS3 图像悬停在圆形 div 之外并带有过渡,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23245116/