Skip to content

Headings need heading markup, not styled paragraphs

  • Rule: axe/p-as-heading
  • Checks: Styled <p> elements must not be used as headings
  • WCAG: 1.3.1
  • Fix class: mechanical: A fix needs no authored text or visual decision.
  • People who use a screen reader or a braille display, most of them blind.

A short paragraph styled to look like a heading introduces the paragraphs after it

Section titled “A short paragraph styled to look like a heading introduces the paragraphs after it”

Make it a heading at the level the outline calls for, and keep its look with CSS.

<h2 class="section-title">Shipping</h2>
<p>Orders ship within two business days.</p>
<p>Tracking details arrive by email.</p>

axe asks for review, such as for a paragraph in a <blockquote> or one styled like the paragraph before it

Section titled “axe asks for review, such as for a paragraph in a <blockquote> or one styled like the paragraph before it”

Decide whether the text introduces the content after it. If it does, make it a heading; if it is a quote, a lead-in or a callout, leave it a <p>.

axe checks only <p> elements, so it stops reporting it, but the text is still not a heading for screen reader users.

axe-core’s documentation of the rule

CORA’s fix guidance adapts content from accessibility-agents, under the MIT License: see its notice.