+ 4

Background of a webpage

I need help with something, I want to put opacity in the background of a webpage (which is an image) without affect the whole body, only the image. How can I do? Thank you !

10th Nov 2019, 4:39 PM
Franlex Eduardo Ramírez Polidor
Franlex Eduardo Ramírez Polidor - avatar
6 odpowiedzi
+ 4
body { font-family:Blippo, fantasy; background: url(https://images.unsplash.com/photo-1534438327276-14e5300c3a48?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&w=1000&q=80); color:black; font-size:18px; }
10th Nov 2019, 5:24 PM
Franlex Eduardo Ramírez Polidor
Franlex Eduardo Ramírez Polidor - avatar
+ 4
I put that Code, but when I put the opacity It affects the text that I have and i want to affect only the image
10th Nov 2019, 5:26 PM
Franlex Eduardo Ramírez Polidor
Franlex Eduardo Ramírez Polidor - avatar
+ 3
I'm also a beginner in html, but here is how I would do it: HTML code: <div id="background-image"></div> CSS code: html, body { width: 100%; height: 100%; } #background-image { position: fixed; z-index: -1; width: 100%; height: 100%; background-image: (path to image); opacity: (your opacity); }
10th Nov 2019, 6:48 PM
Aymane Boukrouh
Aymane Boukrouh - avatar
+ 2
How did you do it ? Post your code here so we can correct it
10th Nov 2019, 5:01 PM
Aymane Boukrouh
Aymane Boukrouh - avatar
21st Jul 2020, 3:20 AM
shubham kumar
shubham kumar - avatar