I know this is a really old thread, but it shows up at the top in Google, so here’s another option.
This one is pure CSS, and doesn’t require any extra HTML.
box-shadow: inset 0 0 0 1000px rgba(0,0,0,.2);
There are a surprising number of uses for the box-shadow feature.
More Related Contents:
- How to add a color overlay to a background image? [duplicate]
- CSS: background image on background color
- How to apply a CSS filter to a background image
- Using percentage values with background-position on a linear-gradient
- How do I combine a background-image and CSS3 gradient on the same element?
- Can I have multiple background images using CSS?
- Responsive css background images
- Background color of text in SVG
- How can I force browsers to print background images in CSS?
- Changing Background Image with CSS3 Animations
- Is embedding background image data into CSS as Base64 good or bad practice?
- IE 8: background-size fix [duplicate]
- CSS background-size: cover + background-attachment: fixed clipping background images
- How to rotate the background image in the container?
- Using HTML data-attribute to set CSS background-image url
- What is the difference between background and background-color
- Google Chrome Extensions – Can’t load local images with CSS
- Disable antialising when scaling images [duplicate]
- Is background-color:none valid CSS?
- CSS blur on background image but not on content [duplicate]
- Background with 2 colors in JavaFX?
- Symfony2 – Assetic – load images in CSS
- Is this possible to create 2-axis 4 color gradient in css (bilinear gradient)?
- Is it possible to change only the alpha of a rgba background colour on hover?
- Overlay a background-image with an rgba background-color
- Animate CSS background-position with smooth results (sub-pixel animation)
- Full background image with fade effect
- CSS: background image does not fill when scrolling
- CSS background image URL failing to load
- Issues with “background-position” in “background” shorthand property