I have a user-uploaded image (almost always JPEG) that I would like to use as a background. To make it less distracting and keep the content on it legible, I try to reduce its opacity. In fact, I would like something with an effect, like a solid color rgba.
I tried putting the background in a div with a negative bottom margin up, pulling the contents above it:
<div style="height: 200px; bottom: -200px; background: url(example.jpg) no-repeat; opacity: 0.5;"></div>
However, it seems hacky and only partially works. This is exactly what I want until I go there opacity; it puts the div on top. (How opacitydoes layering affect ??)
I considered position: absolutefor a background div and content so that I can play with z-index, but which breaks the template in which it all resides.
How to get this image as a translucent background?
source
share