Skip to main content

Archive

Show more

Foundation CSS Breadcrumbs

Foundation CSS Breadcrumbs

Foundation CSS Breadcrumbs are a navigational aid that allows users to track their current location within a website or web application. They provide a hierarchical trail of links, showing the path from the homepage to the current page. Here's how to implement breadcrumbs in your Foundation CSS project:


1. Markup

Start by adding the necessary HTML markup for the breadcrumbs component.

<nav aria-label="You are here:">
  <ul class="breadcrumbs">
    <li><a href="#">Home</a></li>
    <li><a href="#">Section</a></li>
    <li class="disabled">Current Page</li>
  </ul>
</nav>

2. Styling

Style the breadcrumbs component using CSS to match your website's design.

.breadcrumbs {
  list-style: none;
  margin: 0;
  padding: 0;
}

.breadcrumbs li {
  display: inline;
}

.breadcrumbs li:not(:last-child):after {
  content: '/';
  margin: 0 0.5rem;
}

.breadcrumbs li:last-child {
  font-weight: bold;
  color: #333;
}

3. Accessibility

Ensure accessibility by providing appropriate ARIA attributes and semantics.

  • Use aria-label to provide a label for the breadcrumbs navigation.
  • Use aria-current="page" to indicate the current page in the breadcrumbs.

Conclusion

Foundation CSS Breadcrumbs are a useful navigational element that helps users understand their location within a website or application. By following these steps and customizing the markup and styles as needed, you can create breadcrumbs that improve usability and enhance the user experience.

Comments