很基本的代码啊,IE和360浏览器都行,求教。代码如下:
<!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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>页面布局</title> <style type="text/css"> body { margin-top: 0px; } </style> </head> <body> <table width="960" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="212" height="71" rowspan="3"><img src="" alt="" name="logo" width="213" height="120" id="logo" style="background-color: #FF0033" /></td> <td width="599" height="71" rowspan="3"><img src="" width="604" height="120" alt="" style="background-color: #0099FF" /></td> <td width="143" height="40" align="left" valign="middle" bgcolor="#FFFF00">■设为首页</td> </tr> <tr> <td width="142" height="40" align="left" valign="middle" bgcolor="#FFFF00">■加入收藏</td> </tr> <tr> <td width="142" height="40" align="left" valign="middle" bgcolor="#FFFF00">■联系我们</td> </tr> </table> <table width="960" border="0" align="center" cellpadding="0" cellspacing="0"> <tr bgcolor="#CCFF99"> <td align="center" valign="middle"> </td> <td align="center" valign="middle">网页栏目</td> <td align="center" valign="middle"> </td> <td align="center" valign="middle">网页栏目</td> <td align="center" valign="middle"> </td> <td align="center" valign="middle">网页栏目</td> <td align="center" valign="middle"> </td> <td align="center" valign="middle">网页栏目</td> <td align="center" valign="middle"> </td> <td align="center" valign="middle">网页栏目</td> <td align="center" valign="middle"> </td> <td align="center" valign="middle">网页栏目</td> <td align="center" valign="middle"> </td> <td align="center" valign="middle">网页栏目</td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> </table> <script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js"></script> </head> <body> <div id="full" style="display:none; width:50px; height:95px; position:fixed; left:50%; top:460px; margin-left:482px; z-index:100; text-align:center; cursor:pointer;"> <a><img src="image/back-top.png" border=0 alt="返回顶部" title="返回顶部"></a> </div> <table width="960" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="220"><table bordercolor="#FFFFFF"width="100%" border="1" cellspacing="0" cellpadding="0"> <tr> <td bordercolor="#0099FF"> </td> </tr> <tr> <td bordercolor="#0099FF" height="140"> </td> </tr> </table></td> <td> </td> <td width="300"> </td> </tr> </table> <script type="text/javascript"> var isie6 = window.XMLHttpRequest ? false : true; function newtoponload() { var c = document.getElementById("full"); function b() { var a = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; if (a > 0) { if (isie6) { c.style.display = "none"; clearTimeout(window.show); window.show = setTimeout(function () { var d = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; if (d > 0) { c.style.display = "block"; c.style.top = (480 + d) + "px" } }, 400) } else { c.style.display = "block" } } else { c.style.display = "none" } } if (isie6) { c.style.position = "absolute" } window.onscroll = b; b() } if (window.attachEvent) { window.attachEvent("onload", newtoponload) } else { window.addEventListener("load", newtoponload, false) } document.getElementById("full").onclick = function () { window.scrollTo(0, 0) }; </script> </body> </html>
<!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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>页面布局</title> <style type="text/css"> body { margin-top: 0px; } </style> </head> <body> <table width="960" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="212" height="71" rowspan="3"><img src="" alt="" name="logo" width="213" height="120" id="logo" style="background-color: #FF0033" /></td> <td width="599" height="71" rowspan="3"><img src="" width="604" height="120" alt="" style="background-color: #0099FF" /></td> <td width="143" height="40" align="left" valign="middle" bgcolor="#FFFF00">■设为首页</td> </tr> <tr> <td width="142" height="40" align="left" valign="middle" bgcolor="#FFFF00">■加入收藏</td> </tr> <tr> <td width="142" height="40" align="left" valign="middle" bgcolor="#FFFF00">■联系我们</td> </tr> </table> <table width="960" border="0" align="center" cellpadding="0" cellspacing="0"> <tr bgcolor="#CCFF99"> <td align="center" valign="middle"> </td> <td align="center" valign="middle">网页栏目</td> <td align="center" valign="middle"> </td> <td align="center" valign="middle">网页栏目</td> <td align="center" valign="middle"> </td> <td align="center" valign="middle">网页栏目</td> <td align="center" valign="middle"> </td> <td align="center" valign="middle">网页栏目</td> <td align="center" valign="middle"> </td> <td align="center" valign="middle">网页栏目</td> <td align="center" valign="middle"> </td> <td align="center" valign="middle">网页栏目</td> <td align="center" valign="middle"> </td> <td align="center" valign="middle">网页栏目</td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> </table> <script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js"></script> </head> <body> <div id="full" style="display:none; width:50px; height:95px; position:fixed; left:50%; top:460px; margin-left:482px; z-index:100; text-align:center; cursor:pointer;"> <a><img src="image/back-top.png" border=0 alt="返回顶部" title="返回顶部"></a> </div> <table width="960" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="220"><table bordercolor="#FFFFFF"width="100%" border="1" cellspacing="0" cellpadding="0"> <tr> <td bordercolor="#0099FF"> </td> </tr> <tr> <td bordercolor="#0099FF" height="140"> </td> </tr> </table></td> <td> </td> <td width="300"> </td> </tr> </table> <script type="text/javascript"> var isie6 = window.XMLHttpRequest ? false : true; function newtoponload() { var c = document.getElementById("full"); function b() { var a = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; if (a > 0) { if (isie6) { c.style.display = "none"; clearTimeout(window.show); window.show = setTimeout(function () { var d = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; if (d > 0) { c.style.display = "block"; c.style.top = (480 + d) + "px" } }, 400) } else { c.style.display = "block" } } else { c.style.display = "none" } } if (isie6) { c.style.position = "absolute" } window.onscroll = b; b() } if (window.attachEvent) { window.attachEvent("onload", newtoponload) } else { window.addEventListener("load", newtoponload, false) } document.getElementById("full").onclick = function () { window.scrollTo(0, 0) }; </script> </body> </html>