The background image is 100% of the window (and resizes it)

Duplicate:

Stretch and scale CSS background
How to stretch a background image to cover the entire HTML element? background image does not stretch full page width

I have a background image of a webpage that should be displayed completely at 100% of the window size. If the window is resized, the image must be resized with it in order to stay at 100%.

CSS does not allow you to set the size of the background image, just the way it is repeated. (but I want him to stretch out)

I assume jQuery is the safest and fastest way to implement this in order to overcome browser incompatibilities. Or can this be done quickly using regular javascript?

+3
source share
1 answer
+8
source

Source: https://habr.com/ru/post/1708508/


All Articles