您好,登錄后才能下訂單哦!
小編給大家分享一下web開發(fā)中404頁面如何自動跳轉(zhuǎn)到首頁,希望大家閱讀完這篇文章之后都有所收獲,下面讓我們一起去探討吧!
404頁面如何自動跳轉(zhuǎn)到首頁?網(wǎng)站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>很抱歉,網(wǎng)站搬新家啦!</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>網(wǎng)站搬新家啦,即將跳轉(zhuǎn)新網(wǎng)址~</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">若網(wǎng)頁未能自動跳轉(zhuǎn)新網(wǎng)址,請點擊下面按鈕進行跳轉(zhuǎn)!</font><br /><br /> <p class="button"> <a href="https://www.baidu.com" title="進入新網(wǎng)址">進入新網(wǎng)址</a> </p> </p> </body> </html>
看完了這篇文章,相信你對“web開發(fā)中404頁面如何自動跳轉(zhuǎn)到首頁”有了一定的了解,如果想了解更多相關(guān)知識,歡迎關(guān)注億速云行業(yè)資訊頻道,感謝各位的閱讀!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。