Back to all reviewers

Use semantic HTML elements

django/django
Based on 5 comments
Html

Structure HTML templates using semantically appropriate elements rather than generic containers. Replace non-semantic elements like `

` and `

` with more meaningful elements such as `

Reviewer Prompt

Structure HTML templates using semantically appropriate elements rather than generic containers. Replace non-semantic elements like <div> and <p> with more meaningful elements such as <nav>, <ol>, <ul>, and include proper accessibility attributes like aria-labelledby and aria-current.

Example:

<!-- Instead of this -->
<p class="paginator">
  
</p>

<!-- Use this -->
<nav class="paginator" aria-labelledby="pagination">
  <h2 id="pagination" class="visually-hidden">Pagination</h2>
  <ul>
    
  </ul>
</nav>

This improves code organization and readability while enhancing accessibility for users with assistive technologies. Proper semantic structure also makes templates more maintainable as the code’s purpose is clearer to other developers.

5
Comments Analyzed
Html
Primary Language
Code Style
Category

Source Discussions