How do I make the fixed background-image? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How do I make the fixed background-image?

I put a background-image and when positioning and using the "cover", I had a problem, when I decrease the width of the window with the Scrollbar, the Image is also responsive, and I don't want that! I wanted to leave the image fixed, I already used "fixed" but when I use that the image disappears, can someone help me? I would really appreciate it.

24th Apr 2022, 3:05 PM
Gileade Lima
Gileade Lima - avatar
1 Answer
0
CSS background-position Property https://www.w3schools.com/cssref/pr_background-position.asp body { background-image: url('w3css.gif'); background-repeat: no-repeat; background-attachment: fixed; background-position: center; }
24th Apr 2022, 3:48 PM
SoloProg
SoloProg - avatar