Sakamoto San Sakamoto San - 6 months ago 22
HTML Question

Auto-scale Background Image

I've been searching for solutions for hours but i still can't find a fixed solution to this
when I resize my browser, repeated image will appear.
https://gyazo.com/7625f773512ff35afb0c09010dca12b1

I tried using background-repeat: no repeat but there will be blank space below which I don't want, I need it to stretch when I resize my browser

body {
background-image: url(../Image/Lost.png);
background-size:cover;

}

Answer

try this

body {
    background: url(" . . . ");
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-size: cover;
}
Comments