Breadcrumb Navigation — Free HTML CSS Snippet
Breadcrumb · Navigation · Plain HTML & CSS · Live preview
Copy & paste
Source Code
<nav class="breadcrumb" aria-label="Breadcrumb">
<ol>
<li><a href="#">Home</a></li>
<li><a href="#">Products</a></li>
<li><a href="#">Electronics</a></li>
<li aria-current="page">Headphones</li>
</ol>
</nav>* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, sans-serif; background: #f8fafc; padding: 32px; }
.breadcrumb ol {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 0;
list-style: none;
font-size: 13px;
}
.breadcrumb li {
display: flex;
align-items: center;
color: #94a3b8;
}
.breadcrumb li + li::before {
content: '/';
margin: 0 8px;
color: #cbd5e1;
}
.breadcrumb a {
color: #6366f1;
text-decoration: none;
font-weight: 500;
transition: color 0.15s;
}
.breadcrumb a:hover { color: #4f46e5; text-decoration: underline; }
.breadcrumb li[aria-current="page"] {
color: #1e293b;
font-weight: 600;
}Extend with AI
Take This Snippet Further With AI
The AI prompt for this one is for Patreon supporters ($3 a month), along with a site with no ads. Supporters enter the passcode once and it is remembered in this browser.
What's included
Features
About this UI Snippet
Breadcrumb Navigation — Semantic HTML, CSS Separators & Accessibility

A breadcrumb is a horizontal trail of links showing the user's path through a site hierarchy — Home / Products / Electronics / Headphones. It complements primary navigation like the sidebar nav and mega menu. It answers "where am I?" at a glance, reduces navigation friction, and tells search engines how your pages are structured. Google uses breadcrumb markup to display the path inside search result snippets, which can improve click-through rate.
This snippet gives you a complete, production-ready breadcrumb in plain HTML and CSS — no JavaScript required. It uses semantic markup, CSS-generated separators, and proper ARIA attributes out of the box.
Why ol and li instead of div and span
Breadcrumbs use <ol> (ordered list) rather than divs because the items have a meaningful hierarchical order. Screen readers announce ordered lists differently from generic containers — a VoiceOver user hears "list, 4 items" and can navigate between items with arrow keys. The <nav aria-label="Breadcrumb"> wrapper registers as a landmark region, so screen reader users can jump directly to it via landmark navigation. The last item uses aria-current="page" to tell assistive technology that this item represents the current location — it is not a link, just text.
How the CSS separator trick works
The separators between items are generated entirely in CSS using the adjacent sibling combinator and the ::before pseudo-element: li + li::before { content: '/'; margin: 0 8px; color: #cbd5e1; }. This selector reads "for every li that directly follows another li, insert a / before it." The first item gets no separator because there is no preceding sibling. This approach is better than putting separators in the HTML because they are purely presentational — screen readers ignore ::before content by default, so they read "Home, Products, Electronics, Headphones" without announcing the slashes.
Changing the separator
To change the separator, find content: '/' in the CSS panel and update the value. Use content: '>' for a chevron style, content: '\2192' for a right arrow (→), or content: '\00BB' for a double angle quote (»). You can also replace the text with a short SVG data URI to use an icon separator.
Adding breadcrumb schema for Google
To get Google to show the breadcrumb path in search results, add a JSON-LD script block alongside the HTML. The BreadcrumbList schema lists each item with its name and URL. This snippet's HTML structure already mirrors that schema — each <li> maps to a ListItem. Add the script tag with type="application/ld+json" and Google will parse it at crawl time with no extra rendering needed.
Responsive wrapping
The breadcrumb uses flex-wrap: wrap so it automatically wraps to multiple lines on narrow screens. On very small screens you may want to show only the last two levels — hide earlier items with display: none at a media query breakpoint and add an ellipsis item to indicate the hidden path.
Saving your customised version
After editing, click "Save as" in the editor header, type a name, and press Enter. Saves to IndexedDB and appears in the Saved tab in the sidebar.
Step by step
How to Use
- 1Load the snippetClick "Breadcrumb" in the sidebar Library tab. The HTML and CSS panels load instantly and the preview shows the four-item trail.
- 2Update the labels and linksIn the HTML panel, replace Home / Products / Electronics / Headphones with your actual page names and href values. The last li should have no anchor — just text with aria-current="page".
- 3Change the separatorIn the CSS panel, find li + li::before and update content: '/' to any character or CSS unicode escape. The preview updates instantly.
- 4Adjust coloursUpdate the link colour in .breadcrumb a and the current-page colour in li[aria-current="page"] to match your design system.
- 5Export in your formatClick "HTML" to download a standalone file, "JSX" for a React component, or "Tailwind" for a React + Tailwind CSS version with utility classes.
- 6Save your versionClick "Save as", type a name, and press Enter. Your breadcrumb saves to IndexedDB and appears in the Saved tab.
Real-world uses
Common Use Cases
Got questions?
Frequently Asked Questions
A breadcrumb is a row of links showing the user's current location within a site hierarchy — for example, Home / Products / Electronics / Headphones. It helps users navigate back to parent pages and tells search engines how pages are related. Google can display breadcrumb paths in search result snippets.
Breadcrumb items have a meaningful order — they represent a hierarchy from root to current page. An ordered list (ol) communicates this to screen readers and search engines. Screen readers announce it as a list and allow users to navigate items. Divs and spans have no implicit semantic meaning for navigation.
The rule li + li::before { content: '/' } uses the adjacent sibling combinator to insert a slash before every li that follows another li. The first item gets no separator because it has no preceding sibling. The separator is generated by CSS, so screen readers ignore it and only announce the link text.
Find content: '/' in the CSS panel and replace it with any string. Use content: '>' for a simple chevron, content: '\2192' for →, or content: '\00BB' for ». You can also use a short SVG as a background-image on a ::before pseudo-element with specific width and height instead of a text character.
Add a script tag with type="application/ld+json" in your page head containing a BreadcrumbList object. List each item as a ListItem with position, name, and item (URL). Google uses this to display the breadcrumb path inside search result snippets. The HTML structure in this snippet mirrors the schema exactly.
aria-current="page" on the last breadcrumb item tells screen readers that this item represents the current page. The item is plain text with no anchor tag, so users cannot click it. Screen readers announce it differently from the linked items, making the current location clear to assistive technology users.
Yes. Click "JSX" to download a React component or "Tailwind" for a Tailwind CSS version. In Next.js, replace the href="#" values with your actual route paths and use the Link component instead of anchor tags. The aria attributes work the same in React JSX.
Yes. While the Breadcrumb snippet gives you one pattern to copy, the free Responsive Navbar Builder at webdevpuneet.com/navbar-builder/ designs a whole navigation bar: logo, links and dropdown menus, a mobile hamburger menu (dropdown panel, slide-in drawer or full screen) and a scroll effect (sticky, shrink, hide on scroll or transparent). It has six presets, a live preview that runs the real code, and exports HTML + CSS + vanilla JS, React, Tailwind, Vue 3 or Angular — or you can click Fork & Edit to keep editing it in My Code.