There are a couple of problems with what you're asking for.
First – some browsers make a real pig's ear of resizing images, and they come out looking pixellated, uneven and generally messy. That isn't a look you want on your site. That's why we always recommend getting your image the right size before uploading it onto your website, rather than putting it on at the wrong size and then using HTML (or CSS) to resize it 'on the fly'.
Second – something to think about, are you wanting it to stretch to fit horizontally or vertically or to the larger of the two (keeping the same proportions), or are you wanting it to fill the page exactly, however much it has to distort it? Let's say you have a background image that is 800×600px as a starting point. Someone has a screen of 1920×1080, with two windows side-by-side. That will give an available space of approx 940×1000. Do you want your image to scale to 1.175, so that it just fills the width (but leaves gaps top and bottom)? Or to 1.666 so that it fills the whole page (but you lose bits left and right)? Or do you want to change the aspect ratio from 1.333 to 0.94, making it 40% more stretched in one direction than the other, so that it exactly fits the page?
(I'm not saying any one of those decisions is better than any other ... just that you do need to make that decision on what you mean by your question)