Skip to content

Commit

Permalink
Switch to <ol> for breadcrumb (#37273)
Browse files Browse the repository at this point in the history
* Switch to `<ol>` for breadcrumb

The Breadcrumb Glossary page notes

> _Note: While there's no dedicated semantic HTML element for breadcrumb navigation menus, the <ol> element is commonly used to represent their hierarchical structure._

I suggest following our own advice. From a semantically standpoint, it just makes to use an ordered list.

* Update corresponding CSS

Requested changes from #37273 to update corresponding CSS.
  • Loading branch information
lescx authored Dec 20, 2024
1 parent 3aaeeb6 commit 0dd1289
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ Click "Play" in the code blocks below to edit the example in the MDN Playground:

```html live-sample___breadcrumb-example
<nav aria-label="Breadcrumb" class="breadcrumb">
<ul>
<ol>
<li><a href="#">Home</a></li>
<li><a href="#">Category</a></li>
<li><a href="#">Sub Category</a></li>
<li><a href="#">Type</a></li>
<li><span aria-current="page">Product</span></li>
</ul>
</ol>
</nav>
```

Expand All @@ -39,7 +39,7 @@ body {
padding: 0 0.5rem;
}

.breadcrumb ul {
.breadcrumb ol {
display: flex;
flex-wrap: wrap;
list-style: none;
Expand Down

0 comments on commit 0dd1289

Please sign in to comment.