说明:
因为主要学习的是linux,对html不熟,但站点又需要404页面,因此修改了下新浪的404页面
参考新浪404:www.sina.com.cn/404.html
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title> 页面没有找到 </title> </head> <body background=http://image2.sina.com.cn/home/images/tz-001.gif> //这个就是那个灰条的背景! <script type="text/javascript"> //<!-- function isIFrameSelf(){try{if(window.top ==window){return false;}else{return true;}}catch(e){return true;}} function toHome(){ if(!isIFrameSelf()){ window.location.href="http://news.sina.com.cn/guide/";}} //这里定义5s后跳转的地址 window.setTimeout("toHome()",5000); //定义多久后跳转 //--> </script> <table border=0 cellpadding=0 cellspacing=0 > <tr><td height=134></td></tr> </table> <table width=544 height=157 border=0 cellpadding=0 cellspacing=0 align=center> <tr valign=middle align=middle> <td background=http://image2.sina.com.cn/home/images/tz-002.gif> //这个就是那个小人 <table border=0 cellpadding=0 cellspacing=0 > <tr> <td style=padding-left:80px;padding-top:10px><strong>页面没有找到 5秒钟之后将会带您进入导航页!</strong></td> </tr> </table> </td> </tr> </table> <br /> </body> </html>
实现:
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title> 页面没有找到 </title> </head> <body> <script type="text/javascript"> //<!-- function isIFrameSelf(){try{if(window.top ==window){return false;}else{return true;}}catch(e){return true;}} function toHome(){ if(!isIFrameSelf()){ window.location.href="http://renjianrenai.net/";}} window.setTimeout("toHome()",5000); //--> </script> <div style="text-align:center"> <img src="/Public/404/404.jpg" height="400" alt="404" title="人贱人爱"> <br /> 页面不存在,5秒钟之后将返回<a href="/">人贱人爱</a>! </div> </body> </html>
效果图:
附录:
附录1.chinaz上这篇有百度,淘宝,新浪等的404页面,可以参考下
http://www.chinaz.com/web/2012/1102/280592.shtml
转载请注明:酷喃|coolnull| » 404页面实例