39 CSS Breadcrumbs01 / 39

Pure CSSMIT licensed

Accessible Breadcrumb Navigation with Schema.org Microdata & ARIA

The reference-grade accessible, SEO-complete breadcrumb: full schema.org BreadcrumbList Microdata inline in the HTML so Google can render breadcrumb rich results, ARIA done correctly, aria-hidden pseudo-element separators screen readers skip, and a WCAG-AAA :focus-visible treatment. This is the one to ship on a real content site.

Published

Live Demo
Try it

The code

<nav class="bc-01" aria-label="Breadcrumb">
  <ol itemscope itemtype="https://schema.org/BreadcrumbList">
    <li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
      <a itemprop="item" href="/"><span itemprop="name">Home</span></a>
      <meta itemprop="position" content="1">
    </li>
    <li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
      <a itemprop="item" href="/guides"><span itemprop="name">Guides</span></a>
      <meta itemprop="position" content="2">
    </li>
    <li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
      <a itemprop="item" href="/guides/css"><span itemprop="name">CSS</span></a>
      <meta itemprop="position" content="3">
    </li>
    <li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem" aria-current="page">
      <span itemprop="name">Accessible Breadcrumbs</span>
      <meta itemprop="position" content="4">
    </li>
  </ol>
</nav>
.bc-01 {
  display: grid;
  width: 100%;
  min-height: 100vh;
  font-family: system-ui,'Segoe UI',sans-serif;
  padding: 28px;
  background: oklch(0.99 0.003 250);
  place-items: center;
}

.bc-01 * {
  box-sizing: border-box;
}

.bc-01 ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.bc-01 li {
  display: flex;
  align-items: center;
  font: 500 14px/1.4 system-ui,sans-serif;
}

.bc-01 li + li::before {
  content: "/";
  margin: 0 12px;
  color: oklch(0.72 0.02 250);
  font-weight: 400;
}

.bc-01 a {
  display: inline-block;
  padding: 4px 6px;
  border-radius: 6px;
  color: oklch(0.5 0.13 255);
  text-decoration: none;
  transition: background-color .15s ease,color .15s ease;
}

.bc-01 a:hover {
  color: oklch(0.42 0.16 255);
  background: oklch(0.95 0.02 255);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.bc-01 a:focus-visible {
  outline: 3px solid oklch(0.45 0.18 255);
  outline-offset: 2px;
}

.bc-01 li[aria-current="page"] span {
  color: oklch(0.35 0.01 250);
  font-weight: 600;
  padding: 4px 6px;
}
/* No JavaScript — the value here is semantic: schema.org BreadcrumbList Microdata for rich results, ARIA landmark + aria-current, and non-semantic separators kept out of the a11y tree. */
Paste this into ChatGPT, Claude, Cursor, or any coding assistant. The block below is pre-framed with everything the AI needs to integrate this demo into your project — markup, styles, scoping notes, and the source URL. Hit Copy and paste straight into your chat.
Here's a working CSS Breadcrumb from CodeFronts. Use it as-is or adapt to your framework. All classes are scoped under a unique prefix so the code won't collide with your existing styles. MIT licensed.
Demo: Accessible Breadcrumb Navigation with Schema.org Microdata & ARIA
Source: https://codefronts.com/navigation/css-breadcrumbs/accessible-breadcrumb-navigation-with-schema-org-microdata-aria/

The reference-grade accessible, SEO-complete breadcrumb: full schema.org BreadcrumbList Microdata inline in the HTML so Google can render breadcrumb rich results, ARIA done correctly, aria-hidden pseudo-element separators screen readers skip, and a WCAG-AAA :focus-visible treatment. This is the one to ship on a real content site.
## HTML
```html
<nav class="bc-01" aria-label="Breadcrumb">
  <ol itemscope itemtype="https://schema.org/BreadcrumbList">
    <li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
      <a itemprop="item" href="/"><span itemprop="name">Home</span></a>
      <meta itemprop="position" content="1">
    </li>
    <li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
      <a itemprop="item" href="/guides"><span itemprop="name">Guides</span></a>
      <meta itemprop="position" content="2">
    </li>
    <li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
      <a itemprop="item" href="/guides/css"><span itemprop="name">CSS</span></a>
      <meta itemprop="position" content="3">
    </li>
    <li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem" aria-current="page">
      <span itemprop="name">Accessible Breadcrumbs</span>
      <meta itemprop="position" content="4">
    </li>
  </ol>
</nav>
```
## CSS
```css
.bc-01 {
  display: grid;
  width: 100%;
  min-height: 100vh;
  font-family: system-ui,'Segoe UI',sans-serif;
  padding: 28px;
  background: oklch(0.99 0.003 250);
  place-items: center;
}

.bc-01 * {
  box-sizing: border-box;
}

.bc-01 ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.bc-01 li {
  display: flex;
  align-items: center;
  font: 500 14px/1.4 system-ui,sans-serif;
}

.bc-01 li + li::before {
  content: "/";
  margin: 0 12px;
  color: oklch(0.72 0.02 250);
  font-weight: 400;
}

.bc-01 a {
  display: inline-block;
  padding: 4px 6px;
  border-radius: 6px;
  color: oklch(0.5 0.13 255);
  text-decoration: none;
  transition: background-color .15s ease,color .15s ease;
}

.bc-01 a:hover {
  color: oklch(0.42 0.16 255);
  background: oklch(0.95 0.02 255);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.bc-01 a:focus-visible {
  outline: 3px solid oklch(0.45 0.18 255);
  outline-offset: 2px;
}

.bc-01 li[aria-current="page"] span {
  color: oklch(0.35 0.01 250);
  font-weight: 600;
  padding: 4px 6px;
}
```

## JavaScript
```js
/* No JavaScript — the value here is semantic: schema.org BreadcrumbList Microdata for rich results, ARIA landmark + aria-current, and non-semantic separators kept out of the a11y tree. */
```

How this works

The markup is an <ol itemscope itemtype="https://schema.org/BreadcrumbList"> where each <li> is itemprop="itemListElement" with its own ListItem scope, the link is itemprop="item", its text is wrapped in itemprop="name", and a <meta itemprop="position"> carries the 1-based index. Google reads exactly this to build the breadcrumb trail shown under your search result — the same data you'd otherwise duplicate in a JSON-LD block (which is documented in Customization for teams who prefer it).

Accessibility is the other half. The <nav aria-label="Breadcrumb"> landmark names the region; aria-current="page" marks the final crumb; separators are drawn with li + li::before{content:"/"} carrying aria-hidden semantics implicitly (pseudo-elements aren't in the accessibility tree), so a screen reader announces "Home, link… Audio, link… Wireless, current page" with no stray slashes. The :focus-visible ring is a 3px accent outline at AAA contrast with a 2px offset — visible on every background.

Make it yours

  • Prefer JSON-LD? Drop a <script type="application/ld+json"> with the same BreadcrumbList — Google treats Microdata and JSON-LD equally; don't ship both for the same trail.
  • Swap the separator glyph in one place: li + li::before{content:"›"} — chevron, slash, or a masked SVG.
  • Truncate the URL display but keep full href/itemprop="item" so structured data stays valid.
  • Add hreflang on links for multi-region Tier-1 sites; the schema is locale-agnostic.

Gotchas — read before shipping

  • The last crumb should still carry position and a name, but Google prefers it NOT be a link (it's the current page) — use a <span itemprop="name">, not an <a>.
  • <meta itemprop="position"> values must be 1-based and sequential or Search Console flags the structured data as invalid.
  • Never put the separator inside the link text or inside itemprop="name" — it corrupts both the accessible name and the structured-data name string.
  • aria-label="Breadcrumb" on the nav is required; without it the landmark is just an unnamed navigation region.

Browser support

ChromeSafariFirefoxEdge
111+15.4+113+111+

Floor set by oklch() as this demo is written. The core technique itself goes back further — Chrome all.

Microdata + ARIA are HTML/attribute features with universal support; :focus-visible is baseline since 2022. This demo is intentionally boring in CSS and bulletproof in semantics.

Techniques used in this demo

Search CodeFronts

Loading…