CSS Decorative Images and the Silence That Protects Users

Marcus
digitalwcagcssscreen readersdesign systemsautomated testing

Marcus · AI Research Engine

Analytical lens: Operational Capacity

Digital accessibility, WCAG, web development

AI-assisted · Source-linked · Editorially reviewed · Methodology

Trust note

This article was drafted with AI assistance, reviewed against accessibility.chat editorial standards, and should be treated as research and education rather than legal advice. We prioritize primary sources and correct material errors.

Business team in a modern office brainstorming ideas on a whiteboard. Engaged discussion and planning.
Photo by cottonbro studio on Pexels

What does it mean to make something invisible to assistive technology — and why does getting that right matter more than it looks?

That question sits at the heart of WCAG Technique C9 (opens in new window), one of W3C's official sufficient techniques for meeting 1.1.1 Non-text Content (opens in new window). The technique is deceptively simple: use CSS to include decorative images instead of HTML <img> elements, so assistive technologies never encounter them in the first place. No alt text needed. No aria-hidden gymnastics. The image simply doesn't exist in the accessibility tree.

Simple in concept. Surprisingly easy to misapply in practice.

The Technique

C9 describes a specific authoring pattern: when an image is purely decorative — it adds visual interest but carries no information — render it via CSS rather than HTML markup. The W3C document identifies four CSS properties that accomplish this:

  • background (shorthand)
  • background-image
  • content combined with ::before / ::after pseudo-elements
  • list-style-image

The official examples from the source material show two clean applications. First, a full-page background texture:

CSS
body {
background: ffe url('/images/home-bg.jpg') repeat;
}

Second, a decorative rollover effect on a link:

CSS
a:hover {
background: ffe url('/images/hover.gif') repeat;
color: 000;
text-decoration: none;
}

Neither image requires alt text. Neither appears in the DOM. Screen readers, braille displays, and other assistive technologies pass over them entirely — which is exactly the intended behavior.

The technique's scope is deliberately narrow. The W3C document is explicit: "This technique is not appropriate for any image that conveys information or provides functionality, or for any image primarily intended to create a specific sensory experience." C9 only applies when the image is genuinely decorative. The moment an image communicates meaning — a status icon, a chart, a logo — it belongs in HTML with proper alt text, not in a stylesheet.

Why This Matters for Real Users

For a screen reader user, every <img> element without proper alt text is a potential interruption. Some screen readers announce the filename. Others say "image" with no further context. Multiply that across a page with a dozen decorative dividers, background textures, and hover effects, and the cognitive load becomes real noise — not just a minor inconvenience.

The CSS-based approach eliminates that noise at the source. Background images rendered via CSS are not part of the accessibility tree. JAWS, NVDA, VoiceOver — none of them announce what isn't there.

There's a second benefit the W3C document highlights that often gets overlooked: user control. When users apply custom stylesheets, enable high-contrast mode, or disable CSS entirely for readability, CSS background images simply disappear. An <img alt=""> with display:none might still interfere with certain assistive technology configurations. A CSS background image is gone — cleanly, completely. For users who rely on high-contrast settings or custom display configurations, this is meaningful.

The population affected by poor decorative image handling isn't small. Screen reader users, users with cognitive disabilities who rely on simplified displays, users with low vision using custom contrast settings — all of them benefit when decorative content stays out of the content layer.

How It Works in Code

The pattern requires no special markup. The image lives entirely in CSS:

CSS
/* Decorative section divider — CSS only, invisible to AT */
.section-divider {
background-image: url('/images/decorative-wave.svg');
background-repeat: no-repeat;
background-size: contain;
height: ;
}
HTML
<!-- No img element. No alt attribute needed. Clean DOM. -->
<div class="section-divider"></div>

Contrast this with the problematic pattern teams often reach for:

HTML
<!-- This requires alt="" to pass automated checks,
but still creates unnecessary DOM nodes -->
<img src="/images/decorative-wave.svg" alt="" role="presentation">

Both approaches can technically satisfy 1.1.1 Non-text Content (opens in new window) — alt="" on an <img> is a valid sufficient technique. But the CSS approach is architecturally cleaner. It removes the image from the content layer entirely, rather than marking it as ignorable after the fact.

For pseudo-element content:

CSS
/* Decorative icon via ::before — no DOM element needed */
.card::before {
content: url('/images/decorative-corner.png');
display: block;
/* Note: content property with images has limited AT support
test across screen readers before relying on this */
}

The content property with ::before/::after deserves a caution flag. Browser and screen reader handling of generated content varies. Test this pattern specifically — don't assume it behaves identically to background-image.

Applying This on Your Team

The classification question comes first. Before writing any CSS, the team needs a shared answer to: Is this image decorative? That's a content decision, not a technical one. Designers and content strategists need to be in that conversation. A bullet-point icon is decorative. A "verified" checkmark on a user profile is not. A background texture is decorative. A product photo is not. Build a decision checklist into your design handoff process.

Automated testing has real limits here. Tools like axe or Lighthouse can flag <img> elements missing alt text, but they cannot evaluate whether a CSS background image should have been a CSS background image. As our research on testing methodology shows, automated tools catch at most 37% of real accessibility issues — and the decorative/informational classification problem sits squarely in the 63% that requires human judgment.

Code review is your best gate. Add a checklist item: Any new <img> element — is this actually decorative? Should it be a CSS background instead? Catching misclassified images at review costs nothing. Retrofitting them after a screen reader audit costs significantly more.

Design systems are the force multiplier. If your component library establishes a clear convention — decorative images go in CSS, informational images go in HTML with meaningful alt text — developers stop making this decision case-by-case. The pattern is encoded. The default is correct.

PatternAT VisibilityHigh-Contrast SafeRecommended Use
background-image in CSSHidden✓ YesDecorative backgrounds, textures, dividers
<img alt=""> in HTMLHidden (with empty alt)PartialDecorative inline images when CSS isn't feasible
<img alt="description"> in HTMLAnnouncedPartialAll informational images
content: with ::before/::afterVaries by AT✓ YesDecorative accents — test thoroughly

CORS Perspective

Through an operational capacity lens, C9 is a strong candidate for any team's accessibility baseline — not because it's technically complex, but because it's architecturally clean and scales well. The community impact is real: screen reader users and high-contrast users benefit directly from decorative images that stay out of the content layer. The risk dimension is straightforward — misclassified decorative images as <img> elements without alt text are flagged by every automated tool and appear in virtually every accessibility audit, making them high-visibility failures relative to their fix cost. Strategically, encoding this pattern in a design system converts a recurring individual decision into a structural default, which is exactly the kind of organizational capacity building that sustains accessibility programs over time rather than burning teams out on endless one-off remediation.

The silence that C9 creates — an image that assistive technology simply never encounters — is the point. Getting there requires one clear team decision made consistently: Does this image belong in content, or in presentation? Answer that correctly, encode it in your system, and a significant class of 1.1.1 Non-text Content (opens in new window) failures disappears before they're ever written.

About the Marcus lens

An operational lens on digital accessibility. Frames findings around what implementation and maintenance actually require — WCAG conformance, engineering effort, and day-to-day web development practice.

Marcus is an AI analyst lens, not a human staff member. It helps frame this article through a consistent accessibility perspective.

Specialization: Digital accessibility, WCAG, web development

View all articles using this lens →

Transparency Disclosure

This article was drafted with AI assistance and reviewed against our editorial methodology. We disclose that process so readers can judge the work clearly.