自适应卡片风格带按钮的404单页源码

自适应卡片风格带按钮的404单页源码

源码介绍

这是一款采用自适应卡片风格设计的404错误页面源码,界面简洁友好,居中展示提示语“迷失方向了吗?”及说明文字。页面底部提供“返回首页”与“联系支持”两个功能按钮,布局清晰、响应迅速,适配各类设备屏幕,帮助用户优雅处理链接失效或页面丢失的情况。

效果预览

图片[1]-自适应卡片风格带按钮的404单页源码-QQ沐编程

源代码

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>页面未找到 | 404</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        :root {
            --primary: #4f46e5;
            --gray: #6b7280;
            --light-gray: #e5e7eb;
        }
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
            background-color: #f9fafb;
            color: #111827;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            line-height: 1.5;
            padding: 2rem;
        }
        
        .error-container {
            text-align: center;
            max-width: 500px;
            padding: 3rem;
            background: white;
            border-radius: 1rem;
            box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
        }
        
        .error-icon {
            font-size: 5rem;
            color: var(--primary);
            margin-bottom: 1.5rem;
        }
        
        h1 {
            font-size: 2.25rem;
            font-weight: 700;
            margin-bottom: 1rem;
        }
        
        p {
            color: var(--gray);
            margin-bottom: 2rem;
            font-size: 1.125rem;
        }
        
        .action-buttons {
            display: flex;
            gap: 1rem;
            justify-content: center;
            margin-top: 2rem;
        }
        
        .btn {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.75rem 1.5rem;
            border-radius: 0.5rem;
            text-decoration: none;
            font-weight: 500;
            transition: all 0.2s;
        }
        
        .btn-primary {
            background: var(--primary);
            color: white;
        }
        
        .btn-primary:hover {
            background: #4338ca;
            transform: translateY(-2px);
        }
        
        .btn-secondary {
            border: 1px solid var(--light-gray);
            color: var(--gray);
        }
        
        .btn-secondary:hover {
            background: #f3f4f6;
            transform: translateY(-2px);
        }
        
        @media (max-width: 640px) {
            .error-container {
                padding: 2rem;
            }
            
            .error-icon {
                font-size: 4rem;
            }
            
            h1 {
                font-size: 1.75rem;
            }
            
            .action-buttons {
                flex-direction: column;
            }
            
            .btn {
                justify-content: center;
            }
        }
    </style>
</head>
<body>
    <div class="error-container">
        <div class="error-icon">
            <i class="fas fa-map-marked-alt"></i>
        </div>
        <h1>迷失方向了吗?</h1>
        <p>我们似乎找不到您要访问的页面。可能是链接已更改或页面已被移除。</p>
        
        <div class="action-buttons">
            <a href="/" class="btn btn-primary">
                <i class="fas fa-home"></i>
                返回首页
            </a>
            <a href="/contact" class="btn btn-secondary">
                <i class="fas fa-envelope"></i>
                联系支持
            </a>
        </div>
    </div>
</body>
</html>
© 版权声明
THE END
喜欢就支持一下吧
点赞13赞赏 分享