- Success Criterion 1.3.1
- Conformance level A
CSS Display Property Accidentally Stripping an Element’s Role
1.3.1 — Info and Relationships
Scenario
Setting
A budget airline's flight search results
What’s wrong
display:contents (style that can strip an element's role) on semantic elements stripping their role in some browsers.
Example
<div class="heading">Shipping Address</div> Why it matters
Screen-reader, braille, and reading-tool users who depend on coded structure rather than visual layout.
How to test
Inspect elements with display: contents in DevTools' Accessibility Tree: check whether the element's role/semantics survive — some browsers strip them.
How to fix
Avoid display:contents (style that can strip an element's role) on semantic elements, or re-supply the role explicitly.
<h2>Shipping Address</h2>A real heading element exposes the section structure to assistive tech; a styled div doesn't.
Outcome
On a budget airline's flight search results, this barrier is gone for screen-reader, braille — they can complete the task without hitting this wall.
Who is affected
Screen-reader, braille, and reading-tool users who depend on coded structure rather than visual layout.
Learn more
- Understanding Understanding document (opens in a new tab)
Related scenarios
- Text Styled to Look Like a Heading Instead of Coded as One
- Text Columns Faked With Spaces Instead of Real Table Markup
- Table Layout Faked With Spaces Instead of Real Table Code
- Clickable Div Acting as a Link Button With No Real Role
- Structural HTML Tags Used Purely for Visual Styling
- Layout-Only Table Wrongly Coded With Real Header Cells