Skip to main content

Use Markup to Convey Information, Structure, and Relationships

Disabilities Affected: Cognitive, Visual
Success Criterion: 1.3.1
Level: A
Information, structure, and relationships conveyed visually through presentation must also be programmatically determinable or available in text. This means using proper semantic HTML elements to define structure (like headings, lists, tables) and relationships (like labels and form fields, table headers and data cells).

Why It Matters

Screen readers and other assistive technologies rely on the underlying code structure, not just the visual appearance, to interpret content. Using semantic HTML allows these technologies to understand, for example, that a piece of text is a heading, an item belongs to a list, or which header cell corresponds to a data cell in a table. This provides crucial context that is lost if only non-semantic elements (<div>, <span>) with CSS styling are used.

Fixing the Issue

Use native HTML elements according to their semantic meaning. Use <h1><h6> for headings, <ol>, <ul>, and <li> for lists, <table>, <thead>, <tbody>, <th>, and <tr>/<td> for data tables (ensuring <th> elements have appropriate scope attributes or use id/headers), <label> for form labels, <nav> for navigation blocks, <main> for main content, <aside> for sidebars, etc. Avoid using HTML elements solely for their default styling; use CSS for presentation. Use ARIA roles and properties to supplement semantics only when native HTML is insufficient (e.g., for custom widgets).


Good Code Example

Using semantic HTML to convey structure and relationships:

  • <h2>Shopping List</h2>
    <ul>
      <li>Apples</li>
      <li>Oranges</li>
      <li>Milk</li>
    </ul>
    
    <table>
      <caption>Nutritional Information</caption>
      <thead>
        <tr>
          <th scope="col">Food</th>
          <th scope="col">Calories</th>
          <th scope="col">Fat (g)</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <th scope="row">Apple</th>
          <td>95</td>
          <td>0.3</td>
        </tr>
        <tr>
          <th scope="row">Banana</th>
          <td>105</td>
          <td>0.4</td>
        </tr>
      </tbody>
    </table>
    
    <label for="email-addr">Email:</label>
    <input type="email" id="email-addr">
  • Shopping List

    • Apples
    • Oranges
    • Milk
    Nutritional Information
    Food Calories Fat (g)
    Apple 95 0.3
    Banana 105 0.4

Bad Code Example

Using non-semantic elements and CSS, hiding structure from assistive technology:

  • <div style="font-weight: bold; font-size: 1.2em;">Shopping List</div>
    <div>- Apples</div>
    <div>- Oranges</div>
    <div>- Milk</div>
    <div>
      <span style="font-weight: bold;">Food</span>
      <span style="font-weight: bold; margin-left: 10px;">Calories</span>
    </div>
    <div>
      <span>Apple</span>
      <span style="margin-left: 10px;">95</span>
    </div>
    <span>Email:</span>
    <input type="email" id="email-addr">
  • Shopping List
    – Apples
    – Oranges
    – Milk
    Food Calories
    Apple 95
    Email:
Search Ultimate Guide
Tablet displaying an eBook cover titled 'Integrating Accessibility Compliance Into Your Budget' by AccessiTREE. The cover features a digital tree with accessibility-related icons, symbolizing inclusive design and compliance.
Free eBook
Integrating Accessibility Compliance Into Your Budget
A Practical Guide for Healthcare Leaders Navigating the New HHS Ruling

Need Help with Compliance?
Our team is here to guide you through the process of meeting accessibility standards. Contact us today to get started.