Gray out image with CSS?

后端 未结 9 2175
轮回少年
轮回少年 2020-12-02 03:55

What\'s the best way (if any) to make an image appear \"grayed out\" with CSS (i.e., without loading a separate, grayed out version of the image)?

My context is that

9条回答
  •  甜味超标
    2020-12-02 04:41

    Better to support all the browsers:

    img.lessOpacity {               
       opacity: 0.4;
       filter: alpha(opacity=40);
       zoom: 1;  /* needed to trigger "hasLayout" in IE if no width or height is set */ 
    }
    

提交回复
热议问题