1

Possible Duplicate:
Stretch and Scale CSS Background

I am looking for a way to have a background with the following properties: - be fixed - stretch proportionally to window height - cross-browser or at least solutions for all browsers.. (IE especially)

I have searched everywhere but I can't seem to find something to truly work..

Thank you.

Community
  • 1
  • 1
Adrian M.
  • 7,183
  • 15
  • 46
  • 54

2 Answers2

2

reviving the horse? :D anyways, this can't be done by plain CSS.. or can it?

there's what they call background-size:cover in CSS3 (CSS3 is synonymous to "drop that old browser"). otherwise, i'd go for the JS solutions for the sake of older browsers.

here's a demo in w3schools (not a good reference but at least it has a demo)

Joseph
  • 117,725
  • 30
  • 181
  • 234
  • 2
    "reviving the horse? :D" Nope, still dead and beaten. Look at the duplicate, this property has already been covered in multiple answers (I count at least **five** in there, with [one added **this year**](http://stackoverflow.com/a/9017171/106224)). – BoltClock Mar 12 '12 at 07:03