The function you are looking for is filter . It is capable of performing a number of image effects, including brightness:
#myimage { filter: brightness(50%); }
Here you can find a useful article: http://www.html5rocks.com/en/tutorials/filters/understanding-css/
Another: http://davidwalsh.name/css-filters
And most importantly, the W3C specifications: https://dvcs.w3.org/hg/FXTF/raw-file/tip/filters/index.html
Note that this most recently appeared in CSS as a function. It is available, but a large number of browsers are not yet supported there, and those that support it will require a vendor prefix (i.e. -webkit-filter: -moz-filter , etc.).
It is also possible to use filter effects such as SVG. SVG support for these effects is well established and widely supported (CSS filter specifications are taken from existing SVG specifications)
Also note that this should not be confused with the proprietary filter style, available in older versions of IE (although I can predict a problem with namespace conflict when the new style resets the provider prefix).
If this does not work for you, you can still use the existing opacity function, but not in the way you think: just create a new element with a dark dark color, place it on top of your image, and reduce it using opacity . The effect will be due to dimming.
Hope this helps.
Spudley Jul 18 '12 at 6:30 2012-07-18 06:30
source share