body {
background: url('../../asset/background.jpg') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
This is my code for an background image. I want the image to be not resizable when I am resizing the browser.
You shouldn't use background-size:cover;
. With that CSS you're telling the browser you want the background image to expand to cover the whole background area.
If you want the background image centered and not resized, just do this:
body {
background: url('../../asset/background.jpg') no-repeat center center;
}
You can position the background in any manner you like, here are more options.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With