Convert an image to grayscale in HTML/CSS

前端 未结 25 1848
青春惊慌失措
青春惊慌失措 2020-11-22 10:22

Is there a simple way to display a color bitmap in grayscale with just HTML/CSS?

It doesn\'t need to be IE-compatible (and I imagine it won\'t be) -- if

25条回答
  •  爱一瞬间的悲伤
    2020-11-22 10:51

    Try this jquery plugin. Although, this is not a pure HTML and CSS solution, but it is a lazy way to achieve what you want. You can customize your greyscale to best suit your usage. Use it as follow:

    $("#myImageID").tancolor();
    

    There's an interactive demo. You can play around with it.

    Check out the documentation on the usage, it is pretty simple. docs

提交回复
热议问题