3
I’m trying to apply opacity to my background image. I’ve tried using rgba, and the pseudo-class after. Is there any other way to apply this filter only to the image without affecting the content?
This is the HTML
<div id="banner" style="background-image: url(wp-content/themes/enepe/images/bg_header.jpg);">
And the CSS
#banner{
width: 100%;
background-repeat: no-repeat;
background-size: cover;}
Use opacity: 0.5; (Or whatever you prefer)
– Lucas de Carvalho
@Lucascarvalho yes, I’ve used it but it applies to everything in the div...
– Patrick Oliveira
See if it helps: https://css-tricks.com/snippets/css/transparent-background-images/
– Don't Panic