Show where the user is
A trail from the home page to the current page. It helps orientation on deep sites and is great for SEO.
HTML
<nav aria-label="Breadcrumb"> <a href="/">Home</a> / <a href="/tutorials">Tutorials</a> / <span aria-current="page">Navigation</span> </nav>
CSS
nav[aria-label="Breadcrumb"] {
display: flex;
gap: 8px;
align-items: center;
font-size: .9rem;
}
nav[aria-label="Breadcrumb"] [aria-current="page"] {
font-weight: 600; /* highlight the current page */
}
Split content across pages
Numbered controls for moving through long lists of results or posts. Mark the current page so it stands out.
HTML
<nav aria-label="Pagination"> <a href="#">«</a> <a href="#">1</a> <a href="#" aria-current="page">2</a> <a href="#">3</a> <a href="#">4</a> <a href="#">»</a> </nav>
CSS
nav a {
min-width: 36px; height: 36px;
display: inline-flex; align-items: center; justify-content: center;
border: 1px solid #e5e7eb; border-radius: 8px;
}
nav a[aria-current="page"] {
background: #38bdf8; color: #fff; border-color: #38bdf8;
}
Jump back to the top
A button that returns the user to the top of a long page. The simplest version is a link to a top anchor with smooth scrolling — no JavaScript needed.
In a real page this sits fixed in the bottom-right corner.
HTML
<a href="#top" class="back-to-top">↑ Back to top</a>
CSS
html { scroll-behavior: smooth; } /* animate the jump */
.back-to-top {
position: fixed;
bottom: 24px; right: 24px;
display: inline-flex; align-items: center; gap: 8px;
padding: 11px 18px;
border-radius: 999px;
background: #0b1a33; color: #fff;
text-decoration: none;
font-weight: 600; font-size: .85rem;
}
scroll event.Slide a panel in from the edge
A menu that lives off-screen and slides in — common on mobile. This pure-CSS version uses a hidden checkbox as the toggle. Click “Menu” in the demo.
HTML
<input type="checkbox" id="oc"> <label class="open" for="oc">☰ Menu</label> <nav class="panel"> <label class="close" for="oc">×</label> <a href="#">Home</a> <a href="#">Docs</a> <a href="#">Pricing</a> <a href="#">Contact</a> </nav>
CSS
.panel {
position: fixed; top: 0; left: 0; height: 100%;
width: 260px;
transform: translateX(-100%); /* hidden off-screen */
transition: transform .3s ease;
}
#oc { display: none; }
#oc:checked ~ .panel { transform: translateX(0); } /* slide in */
Show progress through steps
A horizontal progress indicator for multi-step flows (checkout, onboarding). Mark completed, current, and upcoming steps differently.
HTML
<ol class="wizard"> <li class="done"><span class="dot">✓</span>Account</li> <li class="done"><span class="dot">✓</span>Profile</li> <li class="active" aria-current="step"><span class="dot">3</span>Payment</li> <li><span class="dot">4</span>Done</li> </ol>
CSS
.wizard { display: flex; list-style: none; }
.wizard li { flex: 1; text-align: center; }
.wizard .dot {
width: 30px; height: 30px; border-radius: 50%;
background: #e5e7eb; margin: 0 auto 6px;
}
.wizard .done .dot { background: #22c55e; color: #fff; }
.wizard .active .dot { background: #38bdf8; color: #fff; }
Jump to a spot on the page
An anchor link points to an element's id on the same page — perfect for a “On this page” table of contents. With scroll-behavior: smooth the jump animates.
HTML
<nav aria-label="On this page"> <a href="#install">Installation</a> <a href="#usage">Usage</a> <a href="#faq">FAQ</a> </nav> <h2 id="install">Installation</h2> <!-- the target --> <h2 id="usage">Usage</h2> <h2 id="faq">FAQ</h2>
CSS
html { scroll-behavior: smooth; } /* animate the jump */
:target { scroll-margin-top: 80px; } /* clear a sticky header */
The whole thing as one file
Several of these patterns — a responsive navbar with a hamburger, breadcrumbs, pagination, and a back-to-top link — combined into one complete HTML file. Copy it into a new file called index.html, open it in a browser, and it just works — no libraries, no build step. Here's the live result, then the full code.
Live preview
Complete HTML — copy this whole file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Navigation Patterns Demo</title>
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: #1f2433; background: #f6f7fb; }
/* ===== Responsive navbar ===== */
.navbar {
display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
padding: 14px 24px; background: #fff; border-bottom: 1px solid #e9edf3;
position: sticky; top: 0; z-index: 100;
}
.navbar .brand { font-weight: 800; font-size: 1.15rem; color: #111; text-decoration: none; }
.navbar .burger {
margin-left: auto; width: 40px; height: 40px; font-size: 1.4rem;
background: none; border: 1px solid #cbd5e1; border-radius: 8px;
color: #111; cursor: pointer;
}
.navbar .links { display: flex; gap: 20px; align-items: center; list-style: none; }
.navbar .links a { color: #4b5563; text-decoration: none; font-size: .95rem; }
.navbar .links a:hover, .navbar .links a.active { color: #2563eb; }
/* ===== Page layout ===== */
main { max-width: 760px; margin: 0 auto; padding: 24px; }
/* ===== Breadcrumbs ===== */
.breadcrumb { display: flex; gap: 8px; align-items: center; font-size: .9rem; color: #6b7280; margin-bottom: 18px; flex-wrap: wrap; }
.breadcrumb a { color: #2563eb; text-decoration: none; }
.breadcrumb .sep { color: #cbd5e1; }
.breadcrumb [aria-current="page"] { color: #111; font-weight: 600; }
.card { background: #fff; border: 1px solid #e9edf3; border-radius: 12px; padding: 24px; margin-bottom: 18px; }
.card h1 { font-size: 1.8rem; margin-bottom: 10px; }
.card p { color: #4b5563; margin-bottom: 12px; }
/* ===== Pagination ===== */
.pagination { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin: 8px 0 28px; }
.pagination a {
min-width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
border: 1px solid #e5e7eb; border-radius: 8px; color: #374151; text-decoration: none; font-size: .9rem;
}
.pagination a:hover { border-color: #2563eb; }
.pagination a[aria-current="page"] { background: #2563eb; color: #fff; border-color: #2563eb; }
/* ===== Back to top ===== */
.back-to-top {
position: fixed; bottom: 24px; right: 24px;
padding: 11px 18px; border-radius: 999px;
background: #0b1a33; color: #fff; text-decoration: none;
font-weight: 600; font-size: .85rem; box-shadow: 0 8px 20px rgba(0,0,0,.18);
}
/* ===== Mobile: collapse links behind the burger ===== */
@media (max-width: 640px) {
.navbar .links {
display: none; width: 100%; flex-direction: column;
align-items: flex-start; gap: 6px; padding-top: 10px;
}
.navbar .links.open { display: flex; }
}
@media (min-width: 641px) {
.navbar .burger { display: none; }
}
</style>
</head>
<body id="top">
<header class="navbar">
<a class="brand" href="index.html">Studio</a>
<button class="burger" aria-label="Toggle menu" aria-expanded="false">☰</button>
<ul class="links">
<li><a href="#" class="active">Home</a></li>
<li><a href="#">Work</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
</ul>
</header>
<main>
<nav class="breadcrumb" aria-label="Breadcrumb">
<a href="#">Home</a><span class="sep">/</span>
<a href="#">Blog</a><span class="sep">/</span>
<span aria-current="page">Navigation Patterns</span>
</nav>
<article class="card">
<h1>Navigation Patterns</h1>
<p>This page wires together four common navigation pieces: a responsive
navbar that collapses behind a hamburger on small screens, breadcrumbs
that show where you are, numbered pagination, and a back-to-top link.</p>
<p>Make the window narrow and the links collapse into the ☰ button.
Scroll down and the back-to-top link returns you here with a smooth jump.</p>
<p style="height: 360px;">Plenty of room to scroll…</p>
</article>
<nav class="pagination" aria-label="Pagination">
<a href="#top">«</a>
<a href="#top">1</a>
<a href="#top" aria-current="page">2</a>
<a href="#top">3</a>
<a href="#top">4</a>
<a href="#top">»</a>
</nav>
</main>
<a class="back-to-top" href="#top">↑ Top</a>
<script>
const burger = document.querySelector('.navbar .burger');
const links = document.querySelector('.navbar .links');
burger.addEventListener('click', () => {
const open = links.classList.toggle('open');
burger.setAttribute('aria-expanded', open);
});
</script>
</body>
</html>
Keep building
See Navigation for nav bars, Mobile Navigation for the hamburger pattern, Tabs, and the Header — or browse the full Component Library.