html
Back to Snippets
HTML Custom 404 Page
A clean, minimal 404 error page with centered layout.
html
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>404 — Page Not Found</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
font-family: system-ui, sans-serif;
background: #0a1628;
color: #f8f6f0;
}
.error {
text-align: center;
padding: 2rem;
}
.error h1 {
font-size: 6rem;
color: #e2b63e;
line-height: 1;
}
.error p {
margin-top: 1rem;
font-size: 1.25rem;
color: #9ca3af;
}
.error a {
display: inline-block;
margin-top: 2rem;
padding: 0.75rem 2rem;
background: #e2b63e;
color: #0a1628;
text-decoration: none;
border-radius: 0.5rem;
font-weight: 600;
}
</style>
</head>
<body>
<div class="error">
<h1>404</h1>
<p>The page you're looking for doesn't exist.</p>
<a href="/">Go Home</a>
</div>
</body>
</html>