Content Inserted Into a Page Using CSS
WCAG Focus: WCAG 1.3.1 (A), 1.1.1 (A)
Themes and plugins sometimes insert labels like "Required", "New!", or warning symbols via CSS pseudo-elements (::before { content: "Required"; }). Not all assistive technologies read CSS-generated text consistently, and browsers treat it as non-selectable decoration rather than real DOM content.
Why This Pattern Violates WCAG
WCAG 1.3.1 Info and Relationships (Level A) and Failure F87 state that inserting non-decorative text via CSS ::before or ::after fails compliance because programmatic meaning must live in the HTML DOM.
Code Comparison
Fails WCAG F87 (Meaningful Text in CSS)
.required-label::after {
content: " (Required)";
color: red;
}
Compliant Real DOM Text
<label for="email">Email Address <span>(Required)</span></label>
How to Fix It in WordPress
- Move any informative words, badges, prices, or asterisk meanings from CSS content rules into real HTML text.
- Keep CSS ::before/::after strictly for decorative flourishes.
Finding This Issue Automatically
CSS pseudo-element tricks hidden in theme stylesheets are notoriously easy to overlook during manual reviews. The WP ADA Compliance Check plugin checks CSS rules for generated content patterns so critical labels stay in real HTML where assistive technology expects them.
WCAG References & Supporting Materials
WCAG Success Criteria
- Understanding WCAG 1.3.1 Info and Relationships (Level A)
- Understanding WCAG 1.1.1 Non-text Content (Level A)
Supporting Documentation & Guides
- W3C Failure F87: Inserting non-decorative content via CSS ::before and ::after — Explains why meaningful CSS generated content is missed under WCAG 1.3.1.
Subscribe
Subscribe to receive daily Web Accessibility - Did you know? articles in your inbox.

