Tip: You can modify some of the code before running
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <ptml xmlns=" http://www.w3.org/1999/xhtml "> <pead> <title>javascript page Bottom fixed layer position code </title > <meta http-equiv= "content-type" content= "text/html;charset=gb2312" > <!--Add the following code to <pead> and </ Head> between--> <style type= "Text/css" > *{margin:0;padding:0; fixed{right:15px;background:lightgreen;left : 15px;bottom:0;line-height:30px;position:fixed;height:30px;} #iefixed {margin:-1px 15px 0px;overflow:hidden;zoom:1;height:1px} </style> <!--[if LT IE 7]> <style type = "Text/css" > Fixed{position:absolute;bottom:auto;clear:both;width:expression (document.getElementById) (' Iefixed '). clientwidth); Left:expression (document.getElementById (' iefixed '). offsetleft); Top:expression (eval ( document.compatmode&&document.compatmode== ' Css1compat ')? documentelement.scrolltop+ ( Documentelement.clientheight-this.clientheight):d Ocument.body.scrolltop+ (document.body.clientheight-this.clientheight)); </style> <script type= "Text/javascript" > Function _fixbackground () {var body = document.body; var blank_gif; if (body.currentStyle.backgroundAttachment!= "fixed") {if (Body.currentStyle.backgroundImage = = "None") {Body . runtimestyle.backgroundimage = "url (" + blank_gif + ")";//dummy body.runtimeStyle.backgroundAttachment = "fixed"; }} window.onload = function () {_fixbackground ();} </script> <! [endif]--> </pead> <body> <div ></div> <!--Add the following code to the <body> and </body>--> <!--[if LT IE 7]><div id= "iefixed" ></div><! [endif]--> <div class= "fixed" ></div> </body> </ptml></td> </tr> </table >
Tip: You can modify some of the code before running