JavaScript page bottom fixed layer position code

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.