css控制層在底部

來源:互聯網
上載者:User
 代碼如下 複製代碼

<!DOCTYPE html PUBLIC"-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/strict.dtd">
<html id="oHTML" xmlns="http://www.w3c.org/1999/xhtml">
<head><title>css控制層在底部</title>
<style type="text/css">
html{overflow: hidden}
body{overflow: auto;}
*{margin:0 auto;padding:0 auto}
#aa{height:30px;border:1px solid red;position:absolute;bottom:0px;left:0px;width:100%}
</style>
</head>
<body id="ll">
<div id="aa">在底部</div>
<span id="ss"></span>
<script language="javascript">
window.onload = function()
{
 var bodyH, htmlH;
 htmlH = document.getElementById("oHTML").offsetHeight;
 bodyH = (htmlH - 4) + "px";
 document.getElementById("ll").style.height = bodyH;
}
function showT(iData)
{
 var s, i;
 var a = [];
 a.push("<table width=\"200\">");
 for (i = 1; i <= iData; i++)
 {
  s = "<tr><td align=\"center\">" + i + "</td></tr>";
  a.push(s);
 }
 a.push("</table>");
 s = a.join("");
 document.getElementById("ss").innerHTML = s;
}
showT(100)
</script>
</body></html>

相關文章

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.