且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

更改背景图像的亮度?

更新时间:2023-11-11 12:57:46

这将是一个选项,但它不是很实用,并且在旧浏览器中不起作用:

This would be an option, but it's not very practical and wouldn't work in older browsers:

body:after {
  content: "";
  position: fixed;
  top: 0; bottom: 0; left: 0; right: 0; 
  background: rgba(0,0,0,0.1);
  pointer-events: none;
}

或者为了更好的颜色控制,试试 hsla() 颜色:

Or for even better color control, try hsla() colors:

body:after {
  content: "";
  position: fixed;
  top: 0; bottom: 0; left: 0; right: 0; 
  background: hsla(180,0%,50%,0.25);
  pointer-events: none;
}

实际上,***在图像编辑器中处理图像,直到获得所需的浏览器结果.

Really, it's better to play with the image in a image editor until you get the browser result you want.