HTML部分:
![](./image/background.jpg)
CSS:
#loginImg{
position:absolute;
top:0px;
left:0px;
z-index:-999px;
}
JavaScript:
window.οnresize=window.οnlοad=function(){ var width_,height_; if(!!((var name = navigator.appName) == "Microsoft Internet Explorer")) /*Microsoft Internet explorer浏览器*/ { if(!!(window.attachEvent && ! window.opera)) { width_=document.documentElement.clientWidth; height_=document.documentElement.clientHeight; } else{ height_=window.innerHeight; width_=window.innerWidth; } } /*Firefox浏览器*/ else if(name = "Netscape") { window.οnresize=window.load=function(){ var width_,height_; if(!!(window.addEventListener && ! window.opera)) { width_ = document.documentElement.clientWidth; height_ = document.documentElement.clientHeight; } else{ height_=window.innerHeight; width_= window.innerWidth; } } } var login=document.getElementById('loginImg').getElementsByTagName('img')[0]; login.width=(width_-5); login.height=(height_-5); }