How to have an image with css filter:blur and sharp edges?

后端 未结 5 1496
暖寄归人
暖寄归人 2021-02-06 06:04

I would like to blur an image when hovering.

The problem is that the edges of the image also blur unpleasantly. In the Fiddle you can see it clearly with the green back

5条回答
  •  时光说笑
    2021-02-06 06:41

    A bit of SVG:

    
    
     
    
    
    
    

    And some CSS:

     #kitten:hover { filter:url(#blur); }  
    

    Should produce the desired effect. http://jsfiddle.net/5Jk6p/

    #kitten:hover {
      filter:url(#blur);
    }
    
      
        
      
      
    

提交回复
热议问题