Each page is a different length, how do I get the background image to look the same on every page and on everyone’s screen resolution? Do I have to resize the image to different pixels to make it work?
Nevertheless, you can use something other than background-size: cover … for example, background-size: 100% auto;. But then you need to work out what to do at the bottom when it needs to repeat. I would fade the rays to a solid color so that you could merge into a background color.
That approach won’t work. There are way too many devices out there, all with different sizes, so there’s no way you can chase them all down. You need to think about it differently, such as what I suggested.
You need to add no-repeat to your background declaration. Modify your code to this:
body {
background: url('../img/background.png') no-repeat;
background-size: 100% auto;
}
You had no-repeat in your original code, but it was attached to the background-image property, which doesn’t work. It either needs to be a part of the background shorthand property (as I’ve done here) or as the value of the background-repeat property. E.g.
body {
background-image: url('../img/background.png');
background-repeat: no-repeat;
background-size: 100% auto;
}
body {
background: #a1c8e0 url('../img/background.png') no-repeat;
background-size: 100% auto;
}
I just chose a color from the image randomly—#a1c8e0—but you can adjust to suit. Ideally, open the image in Photoshop and fade the rays into that color so that the transition from image to bg color isn’t obvious.
EDIT: I also recommend you remove the tiny white text from the bottom right of the image.