日期:2014-05-17 浏览次数:20688 次
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <style type="text/css"> *{padding:0;margin:0;} html,body{ _height:100%; _overflow:hidden; } #header,#footer{ position:fixed; _position:absolute; z-index:1000; width:100%; background:#eee; left:0px; } #content{background:#ccc;_height:100%;_overflow:auto; position:relative; padding:20px; } #header{top:0;} #footer{bottom:0;} </style> </head> <body> <div id="header">header</div> <div id="content"> <script language="javascript"> for(i=0;i<100;i++){ document.write(i+"<br />"); } </script> </div> <div id="footer">定位到底部的层</div> </body> </html>