Background image stretching can be easily accomplished if your browser supports the
background-size property of
CSS 3.
But this property does not work on Firefox 2.0.0.7. In order to emulate similar feature use following code. It will work with short text pages as well as with long pages. Gets automatically resized when window is resized.
It will also work on IE, but background image will not stick (i.e.
position: fixed would not work).
<html>
<head>
<title>Background stretch on Firefox browser</title>
</head>
<body>
<div style="position:fixed; z-index:0; top:0; left:0; width:100%; height:100%;" >
<img src="background.jpg" width="100%" height="100%">
</div>
<div style="z-index:1; position:absolute; top: 0; left: 0">
This is a text over background image. This is a text over background image. This is a text over background image. This is a text over background image.
</div>
</body>
</html>