404页面代码怎么写
经过我们之前说的404页面如何设置,大家也能了解到404页面对于网站优化和用户体验的重要性,那么404页面的代码是如何写的呢,今天给大家分享的就是404页面代码。
在设置自己网站的404页面时,要结合自己的情况修改title部分,另外的话要把body部分的文字改成自己想要的。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- saved from url=(0028)http://www.xiaoercms.com/404.html -->
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>404错误页面</title>
<style type="text/css">
body{margin:0;padding:0;font:14px/1.6 Arial,Sans-serif;background:#fff url(img/body.png) repeat-x;}
a:link,a:visited{color:#007ab7;text-decoration:none;}
h1{
position:relative;
z-index:2;
width:540px;
height:0;
margin:110px auto 15px;
padding:230px 0 0;
overflow:hidden;
xxxxborder:1px solid;
background-image: url(此处插入自己做好的404图片地址,http://www.xx.com/404.jpg);
background-repeat: no-repeat;
}
h2{
position:absolute;
top:55px;
left:233px;
margin:0;
font-size:0;
text-indent:-999px;
-moz-user-select:none;
-webkit-user-select:none;
user-select:none;
cursor:default;
width: 404px;
height: 90px;
}
h2 em{display:block;font:italic bold 200px/120px "Times New Roman",Times,Serif;text-indent:0;letter-spacing:-5px;color:rgba(216,226,244,0.3);}
.link a{margin-right:1em;}
.link,.texts{width:540px;margin:0 auto 15px;color:#505050;}
.texts{line-height:2;}
.texts dd{margin:0;padding:0 0 0 15px;}
.texts ul{margin:0;padding:0;}
.portal{color:#505050;text-align:center;white-space:nowrap;word-spacing:0.45em;}
.portal a:link,.portal a:visited{color:#505050;word-spacing:0;}
.portal a:hover,.portal a:active{color:#007ab7;}
.portal span{display:inline-block;height:38px;line-height:35px;background:url(img/portal.png) repeat-x;}
.portal span span{padding:0 0 0 20px;background:url(img/portal.png) no-repeat 0 -40px;}
.portal span span span{padding:0 20px 0 0;background-position:100% -80px;}
.STYLE1 {
font-family: Arial, Helvetica, sans-serif;
font-size: 65px;
}
</style>
<!--[if lte IE 8]>
<style type="text/css">
h2 em{color:#e4ebf8;}
</style>
<![endif]-->
</head>
<body>
<h1></h1>
<h2><em><span class="STYLE1">404 Error </span></em>:所查找的页面不存在,可能已被删除或您输错了网址!</h2>
<p class="link">
<a href="http://www.xiaoercms.com/">◂返回首页</a>
<a href="http://www.xiaoercms.com/sitemap.xml">◂网站地图</a>
<a href="http://www.xiaoercms.com/">◂返回上一页</a>
</p>
<dl class="texts">
<dt>www.xiaoercms.com正在联系火星总部查找您所需要的页面.请返回等待信息..</dt>
<dd>
<ul>
<li>不要返回吗?</li>
<li>确定不要返回吗?</li>
<li>真的真的确定不要返回吗?</li>
<li>好吧.还是随便你要不要真的确定返回吧</li>
</ul>
</dd>
</dl>
<p></p>
</body></html>
本文标题:404页面代码怎么写
文章内容来源于网络,文章表达观点不代表本站观点,文章版权归原作者所有。若有侵权,请联系本站站长处理!
我们立足合肥,业务覆盖安徽、全国及全球市场。我们凭借一支经验丰富、富有创意、协作无间的专业技术团队,专注于将前沿技术通过高效简捷的途径呈现给客户,量身打造优质解决方案。我们致力于通过持续努力,成为客户在信息化领域值得托付、共创价值的长期战略合作伙伴,协助客户在新经济时代敏锐捕捉商机,拓展发展空间,构筑强大竞争力。小二CMS专注企业数字化转型的智能建站与营销系统,提供从官网搭建、品牌推广到运营增长的一站式服务,助力中小企业低门槛拥有专业级互联网阵地。
了解全部业务
这篇文章对你有帮助吗?
你的每一次鼓励,都是我们持续打磨优质内容的动力


登录后方可参与评论
立即登录