显示效果。

代码:
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>页面未找到 - 正在跳转</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}
body {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
color: white;
overflow: hidden;
}
.container {
text-align: center;
max-width: 600px;
padding: 40px;
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
border-radius: 20px;
box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
position: relative;
overflow: hidden;
}
.container::before {
content: '';
position: absolute;
top: -50%;
left: -50%;
width: 200%;
height: 200%;
background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
z-index: -1;
}
.error-code {
font-size: 120px;
font-weight: 700;
line-height: 1;
margin-bottom: 20px;
text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.2);
color: #fff;
}
.error-message {
font-size: 24px;
margin-bottom: 30px;
font-weight: 300;
}
.redirect-info {
font-size: 16px;
margin-bottom: 30px;
opacity: 0.8;
}
.home-button {
display: inline-block;
padding: 12px 30px;
background: rgba(255, 255, 255, 0.2);
color: white;
text-decoration: none;
border-radius: 50px;
font-weight: 500;
transition: all 0.3s ease;
border: 1px solid rgba(255, 255, 255, 0.3);
backdrop-filter: blur(5px);
}
.home-button:hover {
background: rgba(255, 255, 255, 0.3);
transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}
.animation-container {
margin: 30px 0;
}
.loader {
width: 50px;
height: 50px;
border: 3px solid rgba(255, 255, 255, 0.3);
border-radius: 50%;
border-top-color: white;
animation: spin 1s linear infinite;
margin: 0 auto;
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}
.floating {
animation: floating 3s ease-in-out infinite;
}
@keyframes floating {
0% {
transform: translateY(0px);
}
50% {
transform: translateY(-10px);
}
100% {
transform: translateY(0px);
}
}
@media (max-width: 600px) {
.container {
padding: 20px;
margin: 20px;
}
.error-code {
font-size: 80px;
}
.error-message {
font-size: 20px;
}
}
</style>
</head>
<body>
<div class="container floating">
<div class="error-code">404</div>
<div class="error-message">抱歉,您访问的页面不存在</div>
<div class="animation-container">
<div class="loader"></div>
</div>
<div class="redirect-info">正在为您跳转到首页...</div>
<a href="/" class="home-button">立即前往首页</a>
</div>
<script>
// 立即跳转到首页
window.location.href = "/";
// 如果跳转失败,3秒后再次尝试
setTimeout(function() {
if (window.location.pathname !== '/') {
window.location.href = "/";
}
}, 30000);
</script>
</body>
</html>
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END



![表情[ciya]-红穆笔记](https://www.4s5.cn/wp-content/themes/zibll/img/smilies/ciya.gif)
![表情[xia]-红穆笔记](https://www.4s5.cn/wp-content/themes/zibll/img/smilies/xia.gif)


暂无评论内容