Skip to content
Page·Free

404 page (HTML + CSS)

A "page not found" page in one HTML file. Save it as 404.html on your static site. It links to your home page and to a page for reporting the broken link, and shows a back button when there is a previous page. Light or dark follows the system.

Free to install.

If PocketCode is installed on your Android device, this opens the page in the app.

Preview

404.html · 110 lines
<!doctype html>
<!--
  "Page not found" page in one HTML file, no external files.
  Save it as 404.html at the root of your site (most static hosts serve it on a missing page).
  Change the two links at the bottom; colours live in the CSS variables, dark mode follows the system.
-->
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="robots" content="noindex">
  <title>Page not found</title>
  <style>
    :root {
      color-scheme: light dark;
      --bg: #f7f7fa;
      --fg: #1b1b1f;
      --muted: #55555f;
      --accent: #1f5fd1;
      --accent-fg: #ffffff;
      --line: #7c7c88;
    }
    @media (prefers-color-scheme: dark) {
      :root {
        --bg: #121216;
        --fg: #ececf1;
        --muted: #a8a8b3;
        --accent: #8ab4ff;
        --accent-fg: #0b1a33;
        --line: #7c7c88;
      }
    }
    *, *::before, *::after { box-sizing: border-box; }
    html, body { height: 100%; }
    body {
      margin: 0;
      display: grid;
      place-items: center;
      padding: 24px 16px;
      background: var(--bg);
      color: var(--fg);
      font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    }
    main { width: 100%; max-width: 480px; text-align: center; }
    .nf-code {
      margin: 0;
      font-size: clamp(4rem, 22vw, 7rem);
      font-weight: 800;
      line-height: 1;
      letter-spacing: -0.04em;
      color: var(--muted);
    }
    h1 { margin: 16px 0 8px; font-size: 1.75rem; line-height: 1.25; }
    p { margin: 0 0 32px; color: var(--muted); }
    .nf-actions {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 12px;
      margin: 0;
      padding: 0;
      list-style: none;
    }
    .nf-actions a, .nf-actions button {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 48px;
      padding: 12px 20px;
      border-radius: 8px;
      font: inherit;
      font-weight: 600;
      text-decoration: none;
      cursor: pointer;
    }
    .nf-primary { border: 0; background: var(--accent); color: var(--accent-fg); }
    .nf-secondary { border: 1px solid var(--line); background: transparent; color: var(--fg); }
    .nf-actions a:focus-visible, .nf-actions button:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 3px;

This preview is shortened. You get the full content when you install it.

Changes in 1.0.0

First version.

Related

Contact form (HTML + CSS)FreePageA contact form in one HTML file: name, email, an optional topic and the message. Every field has a label, and a red border appears only after someone types in it or tries to send. Set the form's action to your endpoint. Dark mode follows the system.Pricing section (HTML + Tailwind)FreePageThree pricing plans in plain HTML with Tailwind CSS 4 classes, with no React or JavaScript. The cards stack on phones and switch to dark colours with the system setting. Your project needs Tailwind to build the styles. Replace the example plans and prices with yours.Landing hero (Next.js + Tailwind)FreePageHero section for the Next.js App Router: a title, a subtitle and two links over a soft gradient. It uses dark colours when the system is in dark mode.Static landing pageProProject templateA one-page site in plain HTML and CSS with a header and folding menu, a hero, a feature grid, an FAQ and a footer. Colours follow the system's light or dark setting. There is no build step and it doesn't need Linux: open index.html and tap the globe icon.Login screen (Compose)FreePageEmail and password screen in Material 3. It checks both fields when you tap Sign in, shows the error your server returns, and can add Forgot password and fingerprint buttons. You call BiometricPrompt yourself.Settings screen (Compose)FreePageMaterial 3 settings screen with switches, a theme choice and a text size slider. It holds no state: you pass a SettingsState in and get the changed copy back. Each row is one touch target of 56 dp or more that TalkBack reads as a switch or radio button.