Hmm, I guess I have a solution.
My first idea was derived from Stu Nicholls' example at CSS Play (the forum won't allow me to post a link, but if you google for "Stu Nicholls background", you'll find the page).
Stu streched an image to cover the whole browser window in this way:
position:absolute; width:100%; height:100%;
This of course changes the height/width ratio of the image to fit the browser window, since the images is streched to fit that window. I wanted the image to be only vertically scaled to fit the window height, and to retain its own ratio. So I changed Stu's example to:
position:absolute; height:100%; margin-left:auto; margin-right:auto;
While this works well in Firefox and Internet Explorer, it does not work in Opera. Opera appears not to apply the margin:auto to elements that are absolutely positioned. (And it appears not to apply it to inline elements like images.)
So my solution was twofold:
Set the image to display:block and not position it absolutely, so as to allow Opera to center it with margin:auto. Then set the height of the html, body and wrapping div to 100%, to give a reference for the image's height of 100%. Like this:
html,body,#wrapper{height:100%;}
#background{height:100%; margin-left:auto; margin-right:auto; display:block;}
This works in the most recent versions of IE, FF and Opera. I haven't had a chance yet to test in IE 6 and 7.
The complete code for a minimal functional example looks like this:
<!doctype html>
<html>
<head>
<style type="text/css">
html,body,#wrapper{
height:100%;
}
#background{
height:100%;
margin-left:auto;
margin-right:auto;
display:block;
}
</style>
</head>
<body>
<div id="wrapper">
<img id="background" src="some_image.jpg">
</div>
</body>
</html>