Empty Heading

ID

html.empty_heading

Severity

low

Remediation Complexity

low

Remediation Risk

low

Remediation Effort

low

Resource

Reliability

Language

Html

Tags

accessibility, reliability

Description

Flags a heading element (<h1>..<h6>) that has no child elements and no non-blank text.

Rationale

Screen-reader users rely on headings to navigate and understand the structure of a page. An empty heading produces a meaningless landmark, disrupts the heading outline and offers nothing to announce, so every heading should hold a non-blank label.

<h1></h1>                       <!-- FLAW — no content -->

<h1>Title</h1>                  <!-- OK — descriptive text -->

Remediation

Give the heading descriptive text. If a heading wraps a non-text element such as an image, ensure that element supplies an accessible name (for example an alt attribute on <img>).