+ 2
How to change opacity of body background-image in css?
help
15 ответов
+ 6
anni why not try an <IMG> tag and set its opacity and give the IMG the widths and heights of the body so it looks a background IMG?
+ 4
body{
opacity:0.5;
background-image:URL("my image");
}
+ 4
Try googling it or something!
+ 3
hmm anni I'm not too good with html,im really sorry!
+ 2
I believe it would be :
body {
background-color: red;
opacity: 0.5;
}
or try:
body {
background-color: rgb (0, 0, 0);
background-color: rgba (0, 0, 0, 0.5);
}
+ 2
oh you said image :/
+ 2
In stack overflow they say the easiest way is to use an image editor to make an image transparent and then add it into your code, otherwise you need to figure out how to target the child element without affecting the parent element or sibling elements. they suggest the photo editor called Gimp.
+ 1
@Brains Thanx for your ans but it is not working.
i tried it before but it changes opacity of whole elements in html page but doesn't change the opacity of body back-ground image.
+ 1
Maybe it SHOULDN'T be possible to do? What's behind the background anyway??? By definition the background is the BACK image - there's litteraly nothing behind it. If it didn't have 100% opacity, there should be something behind it
+ 1
You could use linear-gradient with background image, linear gradient would make a layer of color toward the background image.
background-image: linear-gradient(to bottom, rgba(255,255,255,.5), rgba(255,255,255,.5)), url(image.jpg);
https://code.sololearn.com/WGeXCDL6IMRg/?ref=app
+ 1
I think Michael is rite and logic of Augustinas is also true.
0
Anybody wants to help to plzz resolve this
0
According to me it is not possible in css to change opacity of body background image
0
Or I might be wrong
- 1
I m trying since morning 😀 but found nothing.