Breadcrumbs are one of those components nobody argues about. Everyone adds them, they look like a row of small grey links, and they get forgotten. But on a store with deep categories they do three separate jobs, and it's easy to get one of them wrong:
They help a visitor who landed from search figure out where they are.
They help screen reader users jump up a level without hunting through the menu.
They give search engines a clear picture of how your pages are related.
Here's a version that handles all three without much code.
Start with plain HTML
<nav aria-label = "Breadcrumb" > <ol class = "breadcrumbs" > <li><a href = "/" > Home </a></li> <li><a href = "/categories/electrical" > Electrical </a></li> <li><a href = "/categories/measuring-instruments" > Measuring instruments </a></li> <li><a href = "/products/digital-multimeter" aria-current = "page" > Digital multimeter </a></li> </ol> </nav>
Enter fullscreen mode
Exit fullscreen mode
A few choices in there are deliberate:
<nav> with an…