Default CSS filter values for brightness and contrast [duplicate]

让人想犯罪 __ 提交于 2019-12-04 06:03:59

I found this and it will certainly help you. The syntax is something like this.

.thing_you_want_to_filter {
  /*
    these are all default values, note that hue-rotate and blur have units.
    You'll also need to include the vendor prefixes.
  */
  filter: grayscale(0);
  filter: sepia(0);
  filter: saturate(1);
  filter: hue-rotate(0deg);
  filter: invert(0);
  filter: opacity(1);
  filter: brightness(0);
  filter: contrast(1);
  filter: blur(0px);

  /* Drop shadow has the same syntax as box-shadow – see below for why it's amazing! */
  filter: drop-shadow(5px 5px 10px #ccc);
}

Chrome 18.0+ and Safari 6+ are the only browsers that support this. For Safari under version 6 it would be like this:

.img
 {
  -webkit-filter:contrast(100%); /* play with the percentages */
  -webkit-filter:brightness(100%);
 }

You can read the sources yourself

http://net.tutsplus.com/tutorials/html-css-techniques/say-hello-to-css3-filters/ http://css3.bradshawenterprises.com/filters/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!