Tint image using CSS without overlay

后端 未结 5 492
时光取名叫无心
时光取名叫无心 2020-12-02 20:36

Is it possible to tint an image with a specific color using CSS without an overlay in a WebKit browser?

Failed attempts

  • Managed to tin
5条回答
  •  醉酒成梦
    2020-12-02 20:56

    How about an underlay then?

    HTML:

    
    

    CSS:

    .tint { background-color:red; display:inline-block; }
    .tint img { opacity:0.8 }
    

    Tweak the color and opacity as you wish. Doesn't really work on images with transparency in them.

提交回复
热议问题