DOM Order

Recipe 6.5 Preserve order

Sample:

Code:

<style>
   ul {
    display: flex;
    gap: 1rem;
    list-style-type: none;
    margin: 0;
    padding: 0;
  }
</style>

<ul>
  <li><a href="#" tabindex="2">One</a></li>
  <li><a href="#" tabindex="3">Two</a></li>
  <li><a href="#" tabindex="1">Three</a></li>
</ul>