HEADINGS: Two Accessibility Tips You May Not Know

An HTML H1 Tag against a purple background

TIP #1: Headings should not contain other headings.

EXAMPLE CODE:

<h1>Sample Heading Text<h1>Subtext</h1></h1>

REMEDIATION:

Remove the nested headings, or replace them with SPAN elements.

<h1>Sample Heading Text<span>Subtext</span></h1>

====

TIP #2: Use HTML headings instead of applying CSS heading styles to non-headings.

EXAMPLE CODE:

<div style="font-size:1.5em; color:#cc0000;">Sample Heading Text</div>

REMEDIATION:

Change the element to an appropriate heading element (H1, H2, H3, etc) and apply CSS styles if necessary.

<h1 style="color:#cc0000;">Sample Heading Text</h1>