Decorative images make websites visually engaging they add personality, brand identity, and visual flow.
But when used incorrectly, decorative images can clutter accessibility tools like screen readers or confuse users who rely on them.
This guide covers how to use decorative images correctly in design and development along with best practices, inclusive language, and code examples for <img>, CSS backgrounds, and SVGs.
What Are Decorative Images?
Decorative images are visuals used purely for aesthetic or stylistic purposes.
They do not add meaningful information or context to the page content.
Examples of decorative images:
- Background patterns or textures
- Icons used for visual style only
- Decorative borders, dividers, or flourish designs
- Abstract illustrations that don’t convey data or meaning
If removing the image doesn’t change the understanding of the page, it’s likely decorative.
Why Decorative Image Accessibility Matters
Screen readers describe images using alternative text (alt text).
But if every background texture, icon, or flourish is announced, users may get overwhelmed by unnecessary information.
That’s why decorative images should be hidden from assistive technologies.
Accessible decorative images improve the user experience by:
- Reducing noise for screen reader users
- Keeping focus on meaningful content
- Making your site compliant with WCAG (Web Content Accessibility Guidelines)
How to Code Decorative Images Correctly
Let’s explore how to handle decorative images using different methods HTML <img>, CSS, and SVG.
1. Using the <img> Tag
When using an HTML image purely for decoration, leave the alt attribute empty (not omitted).
<img src=”decorative-flower.png” alt=””>
Best Practice:
- Use
alt=""(empty quotes) to mark it as decorative. - Do not skip the
altattribute if it’s missing, some screen readers may announce the file name.
When to use:
Use this when the image is in your HTML for layout reasons but doesn’t provide useful content (like a logo repeated in a background).
2. Using CSS Background Images
CSS is ideal for purely decorative visuals because assistive technologies don’t read CSS background images.
.hero {
background-image: url(“pattern.svg”);
background-repeat: no-repeat;
background-size: cover;
}
Best Practice:
- Use CSS for visual-only graphics like textures, borders, or abstract patterns.
- Avoid placing meaningful content in CSS backgrounds it won’t be accessible.
When to use:
Use for design styling (e.g., background shapes, gradients, or textures behind text blocks).
3. Using SVGs as Decorative Elements
SVGs can be decorative too but accessibility depends on how they’re embedded.
Inline SVG example (decorative):
<svg aria-hidden=”true” focusable=”false” width=”40″ height=”40″>
<circle cx=”20″ cy=”20″ r=”20″ fill=”#00aaff” />
</svg>
Best Practice:
- Add
aria-hidden="true"so screen readers ignore it. - Add
focusable="false"for keyboard accessibility compliance (mainly for Internet Explorer or Edge legacy). - Keep inline SVGs out of meaningful content areas unless they convey data or icons.
When to use:
Use inline decorative SVGs for icons, animations, or design flourishes.
Best Practices for Decorative Images
- Use alt=”” for purely decorative
<img>elements.
This tells assistive tech to skip reading them aloud. - Never omit the
altattribute.
An emptyaltis different from noaltmissing it may make screen readers read the file name instead. - Use CSS for purely visual elements.
If the image is only for layout or styling, CSS is often the best and cleanest approach. - Hide decorative SVGs from assistive technology.
Addaria-hidden="true"andfocusable="false"attributes. - Do not use decorative images for content.
If an image adds meaning (like a chart, product image, or icon representing a function), provide descriptive alt text instead. - Maintain color contrast and context.
Even if the image is decorative, ensure it doesn’t interfere with text readability or contrast compliance (WCAG 2.2). - Test with assistive tools.
Use screen readers like NVDA, JAWS, or VoiceOver to ensure decorative images are silent and meaningful images are described properly.
Inclusive Design Tips
- Balance beauty and usability. Aesthetics should enhance comprehension, not distract.
- Use descriptive visuals only when necessary. Every image should serve a purpose visual or informational.
- Work collaboratively. Designers and developers should agree early on which images are decorative versus meaningful.
- Think responsiveness. Decorative visuals should scale or hide gracefully on smaller screens without affecting usability.
Quick Reference Summary
Decorative Image Accessibility Checklist:
- For
<img>: usealt="" - For CSS: use
background-imagefor non-informative visuals - For SVG: add
aria-hidden="true"andfocusable="false" - Keep decorative visuals visually balanced but semantically invisible
- Test with screen readers and accessibility checkers
Conclusion
Decorative images can make your designs beautiful but true beauty is inclusive.
By correctly handling decorative visuals in HTML, CSS, or SVG, you create an experience that’s accessible, elegant, and easy to navigate for everyone