Is there any possibility of giving attributes to a linked item via CSS?
#content-homepage {
background-image: url(../img/back.jpg);
}
I wanted to decrease the opacity of this image
Is there any possibility of giving attributes to a linked item via CSS?
#content-homepage {
background-image: url(../img/back.jpg);
}
I wanted to decrease the opacity of this image
option 1: opacity
works on everyone see link
div.exemplo{
width:150px;
height:150px;
background: url('https://i.imgur.com/r3MHkRT.jpg');
opacity: 0.5
}
<div class="exemplo"></div>
Option 2: filter
see the
compatibilities: link
div.exemplo{
width:150px;
height:150px;
background: url('https://i.imgur.com/r3MHkRT.jpg');
filter: opacity(50%)
}
<div class="exemplo"></div>
See this example:
div.teste {
width: 200px;
height: 200px;
display: block;
position: relative;
}
div.teste::after {
content: "";
background: url('https://i.imgur.com/hlwO5D2.png');
opacity: 0.5;
top: 0;
left: 0;
bottom: 0;
right: 0;
position: absolute;
/* z-index: -1; */
}
<div class="teste">
</div>
Just apply to your project and voila!
If the background is overlapping some element of your project, simply uncomment the z-index line as its elements.