温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

web开发中404页面如何自动跳转到首页

发布时间:2021-09-06 14:35:56 来源:亿速云 阅读:85 作者:小新 栏目:web开发

小编给大家分享一下web开发中404页面如何自动跳转到首页,希望大家阅读完这篇文章之后都有所收获,下面让我们一起去探讨吧!

404页面如何自动跳转到首页?网站404页面是怎么制作的,代码如下。

!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: 0px; padding:0px; font-family:"微软雅黑", Arial, "Trebuchet MS", Verdana, Georgia,Baskerville,Palatino,Times; font-size:16px;}
p{margin-left:auto; margin-right:auto;}
a {text-decoration: none; color: #1064A0;}
a:hover {color: #0078D2;}
img { border:none; }
h2,h3,h4,h5 {
/*display:block;*/
margin:0;
font-weight:normal; 
font-family: "微软雅黑", Arial, "Trebuchet MS", Helvetica, Verdana ; 
}
h2{font-size:44px; color:#0188DE; padding:20px 0px 10px 0px;}
h3{color:#0188DE; font-size:16px; padding:10px 0px 40px 0px;}

#page{width:910px; padding:20px 20px 40px 20px; margin-top:80px;}
.button{width:180px; height:28px; margin-left:0px; margin-top:10px; background:#009CFF; border-bottom:4px solid #0188DE; text-align:center;}
.button a{width:180px; height:28px; display:block; font-size:14px; color:#fff; }
.button a:hover{ background:#5BBFFF;}
</style>

</head>
<body>

<p id="page" style="border-style:dashed;border-color:#e4e4e4;line-height:30px;background:url(sorry.png) no-repeat right;">
<h2>网站搬新家啦,即将跳转新网址~</h2>
<h3>The website is moving to a new home. It is about to jump to the new website. </h3>
<meta http-equiv="refresh" content="0.1;url=https://www.baidu.com">
<font color="#666666">若网页未能自动跳转新网址,请点击下面按钮进行跳转!</font><br /><br />
<p class="button">
<a href="https://www.baidu.com" title="进入新网址">进入新网址</a>
</p>
</p>
</body>
</html>  

看完了这篇文章,相信你对“web开发中404页面如何自动跳转到首页”有了一定的了解,如果想了解更多相关知识,欢迎关注亿速云行业资讯频道,感谢各位的阅读!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

web
AI