.circle {
-webkit-clip-path: circle(120px at center);
clip-path: circle(120px at center);
}
.circle:hover {
cursor:move;
}
<img src="http://www.publicdomainpictures.net/pictures/10000/nahled/2185-1265776088aCTz.jpg" alt="" class=" circle">
有没有办法让悬停只应用于图像的可见部分?
答案 0 :(得分:4)
只有我能看到它才能使它工作的是添加一个包装元素并将剪辑应用到那个但悬停状态到内部元素。
.wrapper {
display:inline-block;
-webkit-clip-path: circle(120px at center);
clip-path: circle(120px at center);
}
.circle {
display:block;
}
.circle:hover {
cursor:move;
}
<div class="wrapper"><img src="//placehold.it/300" alt="" class=" circle"></div>