到目前为止,我还没有找到任何可以使用 clip 属性替代的东西。我试过唱负边距无济于事。现在我最后的希望是javascript。我已经用谷歌搜索了它,但还没有真正找到我要找的东西。
我想要的是剪辑图片的边缘,因此当将模糊滤镜应用于图像时,边缘不会模糊但很清晰。是的,我确实使用了 svg 过滤器,但找不到使过渡平滑的正确方法
<style>
#content{
background:#fff;
}
.one{
width:455px;
height:213px;
overflow:hidden;
display:inline-block;
vertical-align:top;
}
.one img{
position:relative;
top:-30px;
left:-7px;
-webkit-transition: all 0.4s ease-in-out;
-moz-transition: all 0.4s ease-in-out;
-o-transition: all 0.4s ease-in-out;
-ms-transition: all 0.4s ease-in-out;
transition: all 0.4s ease-in-out;
}
.one img:hover{
filter: blur(3px); -webkit-filter: blur(3px); -moz-filter: blur(3px);
-o-filter: blur(3px); -ms-filter: blur(3px);
filter: url(blur.svg#blur);
-webkit-transition: all 0.4s ease-in-out;
-moz-transition: all 0.4s ease-in-out;
-o-transition: all 0.4s ease-in-out;
-ms-transition: all 0.4s ease-in-out;
transition: all 0.4s ease-in-out;
}
</style>
<div id="content">
<span class="one">
<a href="/"><img src="http://0.tqn.com/d/create/1/0/z/I/4/-/forthebirds.jpg" /></a>
</span>
</div>