Replacing sections with divs
dmundra opened this issue · comments
Background Information
We are using the uswds-jekyll
theme in a couple of sites that we also testing with Axe and we found that the <section>
tags used in the banner, hero, and similar throws up this Axe error:
All page content should be contained by landmarks
Link to the specific Axe rule: https://dequeuniversity.com/rules/axe/4.1/region
Reading up on sections in HTML I think it probably better to use <div>
in this case than <section>
for those regions. For reference https://css-tricks.com/how-to-section-your-html/#dont-swap-div-for-a-section. Another option could be to wrap all the <section>
tags in another section like an aside but that might require more work.
Implementation Steps
- Replace sections with divs
Acceptance Criteria
- Run pa11y-ci with axe and confirm 'All page content should be contained by landmarks' error is no longer being reported.
- Reduce
--threshold
of pa11y-ci after the above is fixed to reveal errors if they appear in future pull requests.