CSS Breadcrumbs
Accessible breadcrumb navigation with CSS-generated separators.
HTML
<nav class="breadcrumbs" aria-label="Breadcrumb">
<ol>
<li><a href="#">Home</a></li>
<li><a href="#">Docs</a></li>
<li aria-current="page">Buttons</li>
</ol>
</nav>
CSS
.breadcrumbs ol {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 8px;
margin: 0;
padding: 0;
list-style: none;
font: 500 15px system-ui, sans-serif;
}
.breadcrumbs li + li::before {
content: "/";
margin-right: 8px;
color: #cbd5e1;
}
.breadcrumbs a {
color: #64748b;
text-decoration: none;
}
.breadcrumbs a:hover {
color: #111;
text-decoration: underline;
}
.breadcrumbs [aria-current] {
color: #111;
font-weight: 600;
}
About this CSS Breadcrumbs
This CSS Breadcrumbs is 31 lines of pure CSS (0.5 KB) with no JavaScript and no dependencies. It uses Flexbox. It works in current versions of Chrome, Edge, Safari and Firefox. It works in any stack: plain HTML, React, Vue, Svelte, Astro, WordPress or Webflow.
CSS features used
Customize it
The colors in this snippet. Search and replace them to match your brand:
#cbd5e1#64748b#111
How to use this breadcrumbs
- Copy the HTML and paste it where you want the element to appear.
- Copy the CSS into your stylesheet, or inside a
<style>tag. - Keep the
.breadcrumbsclass name, or rename it in both places. Then tweak colors, sizes and timing to match your design. - Using React or Next.js? Change
classtoclassNamein the HTML. The CSS works as is, including in Tailwind projects (put it in your global stylesheet).
Building with an AI tool?
“Copy for AI” copies a short prompt for Cursor, Claude Code, Lovable, Bolt or v0. Your AI tool opens the Markdown version of this snippet and reads the HTML, CSS and setup notes there. If your tool can't open links, with the code instead. More ways to use copy CSS with AI.