Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Background image at 100% of window (and resizes with it)

Duplicate of:

Stretch and Scale CSS Background
How do I stretch a background image to cover the entire HTML element?
background image doesn’t stretch full page width

I've got a webpage background image, which needs to be displayed fully at 100% of the window's size. If the window is resized, the image needs to resize with it, to stay at 100%.

CSS does not allow you to set the sizes of the background image, only the way it repeats. (but I want it stretched)

I assume jQuery is the safest and quickest way of realizing this, to overcome browser-incompatibleness. Or can this be done quickly with regular javascript?

like image 973
Gerrit Avatar asked Oct 29 '25 14:10

Gerrit


1 Answers

This link might interest you:

How Do you Stretch a Background Image in a Web Page

like image 75
VVS Avatar answered Oct 31 '25 05:10

VVS