3

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?

Community
  • 1
  • 1
Gerrit
  • 1,579
  • 5
  • 16
  • 23
  • alltough it's a duplicate, I like this question's accepted answer better than the ones from the earlier questions. – Gerrit May 17 '09 at 12:05
  • possible duplicate of [How do I stretch a background image to cover the entire HTML element?](http://stackoverflow.com/questions/235855/how-do-i-stretch-a-background-image-to-cover-the-entire-html-element) – Qantas 94 Heavy Jul 20 '14 at 08:23

1 Answers1

8

This link might interest you:

How Do you Stretch a Background Image in a Web Page

VVS
  • 19,405
  • 5
  • 46
  • 65