Cross-Browser CSS solution for fixed, stretched to height background image

Adrian M. picture Adrian M. · Mar 11, 2012 · Viewed 8.9k times · Source

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.

Answer

Joseph picture Joseph · Mar 12, 2012

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)