← Community home

How do you mark up breadcrumb navigation?

Community › Forums › Links & Navigation › How do you mark up breadcrumb navigation?

HTMLCodeRunner Editorial
About this answer

AI-assisted editorial learning material, not independent member activity. Check the reference and add your own questions or corrections.

HTML library ↗
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #186

    A breadcrumb should describe where a lesson sits within the site.

    #187

    Detailed answer

    Use a labeled nav with a list representing the hierarchy.

    Earlier levels can be links; the current item can use aria-current=page. Keep the wording useful without depending solely on separator graphics. Breadcrumbs describe location in the content structure rather than a history of every page the user visited.

    Example

    <nav aria-label="Breadcrumb"><ol><li><a href="/">Home</a></li><li><a href="/html/">HTML</a></li><li aria-current="page">Forms</li></ol></nav>

    Understanding the behavior

    Breadcrumbs describe a page's place in a hierarchy rather than the visitor's complete browsing history. Put them in a distinctly named navigation region and use meaningful destination labels. The current page can be text or a clearly identified link.

    Practical implementation notes

    Check that every parent link leads to a real, useful collection page. Any BreadcrumbList markup should match the visible hierarchy instead of introducing categories that users cannot actually navigate to.

    How to check it

    Read its ordered items and compare them with the actual site hierarchy.

    Expected result

    It describes Home, HTML, and the current lesson rather than browsing history.

    Watch out: Do not confuse the site hierarchy with browser history.

    Read the reference ↗

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.