Skip to content

Replacing sections with divs #241

@dmundra

Description

@dmundra

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    g: initialIssue template needs to be filled out, and/or initiative/timing labels need to be added.i: infrastructureRelating to technology underneath/supporting custom software across TTS

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions