代码如下 | 复制代码 |
<!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> |
时间: 2024-09-25 18:35:51