解决overflow+border-radius+transform圆角问题

网上还有其余版本,可是对我来讲都很差使,下面是我在Chrome上的代码。overflow:hidden依然是不能正常使用,换成unset就能够,读者若是有更好的解决方案,请留言,谢谢。css

<figure>
   <img :src="item.photo" :alt="item.title">
 </figure>
figure {
  border-radius: 10px;
  background: #2f3238;
  /*overflow: hidden;*/
  overflow: unset;
  position: absolute; /* this breaks the overflow:hidden in Chrome/Opera */ 
 /* this fixes the overflow:hidden in Chrome */
  -webkit-mask-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC);
}

figure img {
  display: block;
  transition: opacity 1s, transform 1s;
}

figure:hover img {
  opacity: 0.8;
  transform: scale3d(1.1,1.1,1);
}
相关文章
相关标签/搜索