Home Projects Portfolio Dashboard Export PDF Log in
HTML

Standardizing HTML Semantics for Better Web Accessibility

Introduction

In the Landing-Gs project, we recently conducted a audit of our landing page layouts. A key area for improvement was the misuse of semantic tags, which can impact both SEO performance and accessibility for screen readers.

The Challenge

Our initial markup often conflated container structures with semantic content wrappers. Specifically, we identified instances where custom or generic tags were used in place of standard HTML5 semantic elements. This lack of clear hierarchy made it difficult for browser parsers and assistive technologies to distinguish primary content from decorative elements.

The Solution

We moved toward using the main tag as the primary content wrapper. Standardizing these elements ensures that developers and assistive devices can reliably locate the core information of a page.

<main class="page-content">
  <article>
    <h1>Project Overview</h1>
    <p>This is the primary content area.</p>
  </article>
</main>

The code above demonstrates the shift toward wrapping the primary content of the page in a <main> element. This approach improves the document outline and allows users to bypass navigation blocks efficiently.

Key Decisions

  1. Semantic Clarity: Replaced non-standard content containers with native HTML5 tags.
  2. Accessibility-First: Ensured that the main content region is properly scoped for keyboard navigation.
  3. Consistency: Applied the fix across the primary landing templates to ensure uniform document structures.

Results

  • Improved accessibility scores on Lighthouse audits.
  • Enhanced readability for automated tools.
  • Cleaner, more maintainable template code.

Lessons Learned

Small adjustments to your HTML markup can have outsized impacts on user experience. Always prioritize native tags before opting for custom container classes.

Takeaway: Audit your current codebase for semantic HTML tags—start by ensuring that each page has exactly one <main> landmark element.


Generated with Gitvlg.com

Standardizing HTML Semantics for Better Web Accessibility
G

Gregory Subero

Author

Share: