It's very likely that…
posted on
…if your divs list content and have classnames like “list” or “list-item”, you want to use a proper list like <ol>
or <ul>
instead.
<div class="list">
<div class="list-item">HTML</div>
<div class="list-item">CSS</div>
<div class="list-item">JS?</div>
</div>
More accessible alternative:
<ul>
<li>HTML</li>
<li>CSS</li>
<li>JS?</li>
</ul>
Explanation
Using lists can have many advantages for screen reader users:
- They can get the total number of items before they interact with the items.
- They may use shortcuts to jump from list item to list item.
- They may use shortcuts to jump from list to list.
- The screen reader may announce the index of the current item (for example, "list item, two of four").
- The elements convey their "list" role