Yup , opacity is a tricky thing in CSS. Had the background been a solid color, and not an image, you could easily accomplish the effect using RGBA(). But since that’s not the case you might need to:
USE A EXTRA ELEMENT AN ABSOLUTE POSITIONING.
in this example I am using a pseudo element.
.eg {
position: relative;
/* do NOT try to give div.eg a background, as it will end up covering the pseudo element*/
}
.eg:before {
position: absolute;
background: url('file://localhost/Volumes/Macintosh%20HD/Users/rmessina/Desktop/IMG954638.jpg') no-repeat;
top:0;
bottom:0;
right: 0;
left: 0;
content: '';
opacity: .5;
z-index: -1;
}
<div class="e.g.">content...</div>
BUT…
if the main background is a solid color, that is to say the containers background is a solid color that you can match, you could do this:
.eg {
background: -moz-linear-gradient(left, rgba(248,80,50,0.5) 0%, rgba(231,56,39,0.5) 100%), url('file://localhost/Volumes/Macintosh%20HD/Users/rmessina/Desktop/IMG954638.jpg') no-repeat;
background: -webkit-gradient(left top, right top, color-stop(0%, rgba(248,80,50,0.5)), color-stop(100%, rgba(231,56,39,0.5))), url('file://localhost/Volumes/Macintosh%20HD/Users/rmessina/Desktop/IMG954638.jpg') no-repeat;
background: -webkit-linear-gradient(left, rgba(248,80,50,0.5) 0%, rgba(231,56,39,0.5) 100%) , url('file://localhost/Volumes/Macintosh%20HD/Users/rmessina/Desktop/IMG954638.jpg') no-repeat;
background: -o-linear-gradient(left, rgba(248,80,50,0.5) 0%, rgba(231,56,39,0.5) 100%) , url('file://localhost/Volumes/Macintosh%20HD/Users/rmessina/Desktop/IMG954638.jpg') no-repeat;
background: -ms-linear-gradient(left, rgba(248,80,50,0.5) 0%, rgba(231,56,39,0.5) 100%), url('file://localhost/Volumes/Macintosh%20HD/Users/rmessina/Desktop/IMG954638.jpg') no-repeat;
background: linear-gradient(to right, rgba(248,80,50,0.5) 0%, rgba(231,56,39,0.5) 100%), url('file://localhost/Volumes/Macintosh%20HD/Users/rmessina/Desktop/IMG954638.jpg') no-repeat;
}
the vendor prefixes make it look scarier than it is. Essentially am creating solid color bg image (that matches the main BG color) from a CSS gradient and then overlaying it over the logo image. If you don’t feel comfortable using CSS gradients, you could just do a single pixel semi transparent PNG instead; of course that would mean having to use an image editor, etc… But the principle is the same.
hope that helps.