Brightness filter in firefox and opera without svg file

后端 未结 2 1769
攒了一身酷
攒了一身酷 2020-12-18 11:09

For my current project i used filter -webkit-filter: brightness(-20%);-moz-filter: brightness(-20%); But somewhy, this filter doesnt works in firefox and

2条回答
  •  执念已碎
    2020-12-18 11:41

    If you need a more cross-browser solution, you could make the images translucent when they are not hovered:

    img {
        opacity: .7;
    }
    img:hover {
        opacity: 1;
    }
    

    This will have the effect of darkening them when they are on a dark background.

提交回复
热议问题