Greyscale Background Css Images

后端 未结 5 2156
独厮守ぢ
独厮守ぢ 2020-11-27 14:42

I\'ve searched a lot on the web but I cannot find a cross browser solution to fade a css backgrund image to greyscale and back.

The only working solution is to apply

5条回答
  •  独厮守ぢ
    2020-11-27 15:25

    Here you go:

    
    
    bluantinoo CSS Grayscale Bg Image Sample
    
    
    
        
    this is a non-grayscale of the bg image
    this is a grayscale of the bg image

    Tested it in FireFox, Chrome and IE. I've also attached an image to show my results of my implementation of this.Grayscale Background Image in DIV Sample

    EDIT: Also, if you want the image to just toggle back and forth with jQuery, here's the page source for that...I've included the web link to jQuery and and image that's online so you should just be able to copy/paste to test it out:

    
    
    bluantinoo CSS Grayscale Bg Image Sample
    
    
        
    
    
        
    rollover this image to toggle grayscale

    EDIT 2 (For IE10-11 Users): The solution above will not work with the changes Microsoft has made to the browser as of late, so here's an updated solution that will allow you to grayscale (or desaturate) your images.

    
      
        
          
        
      
      
    

提交回复
热议问题