Skip to content

Breadcrumbs

The path from the front page to where the user is now. The class goes on an <ol> inside a <nav>: the order matters, so the list has to be numbered even though the numbers are not shown.

Three things have to be in the markup:

WhatWhy
<nav aria-label="You are here">Screen readers list the navigation regions on the page. Without the text this one is just called “navigation”.
<ol>, not <ul>The order is part of the meaning
aria-current="page" on the last stepSays which page the user is on. Colour alone says nothing.

The separator is added with CSS. If the slash were in the markup, screen readers would read “slash” between every step.

ClassWhat it is
.lt-breadcrumbsThe list of steps
VariableDefault
--lt-breadcrumbs-gapvar(--lt-spacing-2)

The separator comes from ::before on every step after the first, and can be replaced. Keep the empty alternative text after the character: generated content is read out, and without it the screen reader says the new character between every step, just as it used to say “slash”. The first rule is the fallback for browsers that do not know the syntax and would otherwise discard the whole declaration, as in the stylesheet itself:

.lt-breadcrumbs li + li::before {
content: "›";
}
@supports (content: "/" / "") {
.lt-breadcrumbs li + li::before {
content: "›" / "";
}
}

See Customising for how the variables and the layer work.

  • The last step should be where the user is now, not somewhere to go. Either as a link with aria-current="page", or as plain text.
  • Do not shorten the steps to ”…” on a small screen unless they can be expanded. The user then loses exactly the overview the trail is for.
  • The trail does not replace a back button. It shows where in the structure the user is, not where they came from.