Decorative Images: Fixing Decorative vs Content Image Confusion
Most pages carry images that add nothing but mood: swirls behind a heading, a divider line, a stock photo of a handshake, an arrow next to a button that already says "Next". When these ornaments are coded as ordinary content images they cause two kinds of trouble.
Screen readers announce them, and the browser downloads and prioritises them as if they mattered. This guide shows how to decide which images are ornament, how to mark them so assistive technology skips them, and how to rebuild them in CSS or SVG so they cost as few bytes as possible.
- Why ornamental images cause problems twice
- Deciding which side of the line an image is on
- The fix, step by step
- Before and after markup
- Which marker to use, and which to avoid
- The performance side: what moving decoration changes
- Where decorative images come from on common platforms
- Edge cases
- Keeping decoration light and silent
- Questions and answers
Why ornamental images cause problems twice
A decorative image is one that a visitor would not miss if it vanished. It sets a tone or fills space,
but it carries no fact, instruction or action. The trouble starts when the markup does not say so. An
<img> element with no alt attribute, or with a meaningless value such
as alt="image" or alt="bg-swirl-2", gives a screen reader something to read
aloud. Someone listening to your page hears a string of noise between the headings they actually wanted.
The second problem is less often discussed. Every <img> in the HTML is found by
the browser's preload scanner as soon as the markup arrives, and it joins the queue of downloads alongside
your product photos, your fonts and your scripts. A page with a dozen ornamental images in the first
screen is asking the browser to spend bandwidth on flourishes before it has finished the picture that
actually sells something. On a slow mobile connection that competition is real.
So the fix has two halves that support each other:
- Tell assistive technology to skip it. An empty
alt=""on an image element, oraria-hidden="true"on an inline SVG, removes the item from what a screen reader announces. - Make it cheaper or remove the file entirely. Many ornaments can be drawn with CSS in a few bytes, moved into a stylesheet background that loads later, or turned into a small SVG.
The writing of good descriptions for meaningful images is a separate job, covered in our alt text guide. This page stays with the other side of the line: things that should say nothing and weigh little.
Deciding which side of the line an image is on
The same picture can be decorative on one page and essential on another. A photograph of a sunlit kitchen is ornament on a plumber's contact page and the whole point on a kitchen fitter's portfolio. Judge each image in its context, not by what it depicts.
| Image | Usually | Why |
|---|---|---|
| Background texture, gradient, pattern or blob shape | Decorative | Pure styling with no content. |
| Divider line, corner flourish, bullet graphic | Decorative | Visual structure that the HTML already expresses. |
| Icon beside a text label (a phone icon next to "Call us") | Decorative | The words already say everything the icon says. |
| Icon on its own inside a button or link | Not decorative | It is the only label the control has. |
| Generic stock photo in a blog header | Often decorative | If the article makes sense without it, treat it as mood. |
| Product photo, chart, map, diagram, screenshot | Content | A visitor would lose information without it. |
| Logo in the header linking home | Content | It is a link and needs a name. |
| Photo next to a caption that fully describes it | Either | If the caption says it all, the image can stay silent. |
When in doubt, ask whether a sighted visitor would complain if the image were replaced by a blank space the same size. If the honest answer is "no, it just looks nicer", it is decorative.
alt="", the link has no accessible name at all and a screen reader
will announce it as just "link", or read out the URL.The fix, step by step
Step 1
Inventory the images on each template
Work
template by template rather than page by page, because ornaments almost always come from the theme, header,
footer or a page builder block. Open a representative page, run the Image Optimisation audit, and in
developer tools filter the Network panel to images. Note every file that loads, where it appears, its
transfer size and whether it is an img element, an inline SVG or a CSS background. A spreadsheet
with one row per image keeps the next steps quick.
Step 2
Apply the removal test to each one
For each row, imagine the image replaced by an empty box of the same size and ask whether a visitor loses any fact, instruction or way to act. Mark it content if they would, decorative if they would not, and functional if it is the only thing inside a link or button. Be strict with stock photos and hero backgrounds: most exist to create a mood. Anything marked content leaves this guide and goes to your alt text work.
Step 3
Replace ornaments with CSS where you can
Before deciding how to hide a decorative file, ask whether it needs to be a file at all.
Divider lines become a border-top, soft glows become box-shadow, colour washes
become linear-gradient() or radial-gradient(), rounded frames become border-radius,
and simple arrows or chevrons can be drawn with borders or a short SVG. Each replacement removes an HTTP
request and some bytes, and because nothing is in the HTML, there is nothing for a screen reader to announce.
Step 4
Move remaining decoration into CSS backgrounds
Photographic textures and patterns that must stay as bitmaps belong in the stylesheet
as a background-image, not in the HTML as an img. Screen readers ignore CSS
backgrounds, and the browser only requests them once the stylesheet has been parsed and the element is
found to be visible, so they no longer compete with content images at the start of the load. Use image-set()
to offer WebP or AVIF with a JPEG fallback, and keep each file sized for the largest box it fills.
Step 5
Hide inline SVG icons from assistive technology
For icons drawn as inline SVG next to a visible label, add aria-hidden="true"
to the svg element so it is skipped, and remove any title element inside it
that would otherwise be read. Add focusable="false" if you still support very old Internet
Explorer or legacy Edge builds. If you use an icon sprite, reference symbols with use so
the browser downloads one cached file instead of dozens of separate icon images.
Step 6
Mark decorative img elements that must stay
Some decorative images have to remain as img elements, for example when
a content editor places them in a CMS body. Give each one an explicitly empty alt="" with
nothing between the quotes, not even a space. Keep width and height so the
space is reserved, add loading="lazy" if it sits below the first screen, and add decoding="async".
Never give a decorative image fetchpriority="high"; that priority belongs to the main content
image.
Step 7
Recheck bytes, requests and screen reader output
Reload the page with the cache disabled and compare the number of image requests and total image bytes with the figures from step one. Then listen to the page with NVDA, VoiceOver or TalkBack, moving through it with the arrow keys, and confirm that no ornament is announced while every product photo, chart and linked logo still is. Finally run the Image Optimisation audit again so the decorative items no longer appear among its findings.
Before and after markup
The examples below come from a fictional joinery firm, Oakline Joinery, whose home page had grown a collection of ornaments over several redesigns.
A divider graphic
<!-- Before: a 14 KB PNG with a meaningless alt -->
<img src="/img/divider-gold.png" alt="divider">
<!-- After: no file, no request, nothing announced -->
<hr class="rule-gold">
.rule-gold {
border: 0;
height: 2px;
background: linear-gradient(90deg, transparent, #b8893b, transparent);
margin: 2rem auto;
max-width: 12rem;
}
A styled <hr> is a thematic break, which some screen readers announce as a separator.
If the line is purely ornamental and not a change of topic, use a div or a ::before
pseudo-element instead.
A textured section background
<!-- Before: absolutely positioned img behind the text -->
<section class="about">
<img src="/img/wood-grain.jpg" alt="wood grain" class="about-bg">
<h2>Made in our Derbyshire workshop</h2>
</section>
<!-- After: CSS background with modern formats -->
<section class="about">
<h2>Made in our Derbyshire workshop</h2>
</section>
.about {
background-color: #6b4a2b;
background-image: url("/img/wood-grain-1600.jpg");
background-image: image-set(
url("/img/wood-grain-1600.avif") type("image/avif"),
url("/img/wood-grain-1600.webp") type("image/webp"),
url("/img/wood-grain-1600.jpg") type("image/jpeg"));
background-size: cover;
}
The plain background-image line comes first as a fallback for browsers that do not understand
image-set() with type(). The solid background-color keeps the
heading readable while the texture loads or if it fails.
An icon next to a label
<a href="tel:+441234567890" class="call">
<svg aria-hidden="true" width="20" height="20" viewBox="0 0 24 24">
<use href="/img/icons.svg#phone"></use>
</svg>
Call the workshop
</a>
An icon that is the whole button
<button type="button" class="menu-toggle" aria-label="Open menu">
<svg aria-hidden="true" width="24" height="24" viewBox="0 0 24 24">
<use href="/img/icons.svg#menu"></use>
</svg>
</button>
In the last example the SVG itself is still hidden, but the button carries its name with aria-label.
The icon is decorative; the control is not.
Which marker to use, and which to avoid
There are several ways to tell assistive technology to ignore something. They are not interchangeable, and stacking them rarely helps.
alt=""on animg. The standard, best-supported way. It removes the image from the accessibility tree. Do not also addrole="presentation"; the empty alt already does that job.aria-hidden="true"on ansvgor wrapper. Right for inline SVG and icon font elements. It hides the element and everything inside it, so never put it on anything that contains a link, a button or text a visitor needs.role="presentation"orrole="none". Useful on an SVG in some older setups, but not needed on animgwith empty alt.- CSS backgrounds and pseudo-elements. Not exposed to screen readers at all, which is exactly what you want for ornaments. The catch is that they are also invisible to image search, so only use them for things you do not want indexed.
Things to avoid:
- Leaving out the alt attribute. An
imgwith no alt at all is treated as unlabelled, and many screen readers fall back to reading the file name, such as "swirl underscore final underscore v3 dot png". - A space between the quotes.
alt=" "is not the same asalt=""and some assistive technology treats it as a label. - A title attribute on a decorative image. It produces a tooltip and may be read as the image's name, undoing the empty alt.
- Hiding focusable things.
aria-hiddenon an element that can receive keyboard focus creates a control that keyboard users can reach but screen reader users cannot identify.
The performance side: what moving decoration changes
Moving an ornament from an img to a CSS background does more than silence it. It changes
when and whether the file is downloaded.
- Later discovery. The browser finds CSS backgrounds only after it has downloaded and parsed the stylesheet and worked out which elements are on screen. For decoration that is a benefit, because content images in the HTML get a head start.
- Not fetched when hidden. A background on an element set to
display: none, for instance a desktop-only flourish hidden on phones, is generally not requested at all. A hiddenimgelement in the HTML usually is downloaded anyway unless it is lazy-loaded. - No native lazy loading.
loading="lazy"only works onimgandiframe. Backgrounds far down a long page load when their element's styles apply. If a large decorative background sits well below the first screen, apply its class with a small IntersectionObserver script, or simply make the file smaller.
img with alt="" and
fetchpriority="high", or preload it with <link rel="preload" as="image">.
Our LCP guide explains the timing in detail.Decorative images also tend to be the least carefully exported files on a site, because nobody checks them. A background texture saved as a 3 MB PNG straight from a design tool is common. Once you have decided an image is ornament, it is worth being ruthless: lower quality settings and heavy blur often go unnoticed on a texture that sits behind text.
Where decorative images come from on common platforms
WordPress
In the block editor, the Image block's alternative text field carries a hint to leave it empty if
the image is decorative, and an empty field outputs alt="". The Cover block renders its
background image as an img with empty alt by default, which is correct for decoration but
means it is still fetched early. Theme ornaments are usually in the theme's CSS or template parts, so
a child theme is the safe place to change them.
Shopify
Themes built on Online Store 2.0 often expose decorative images as section settings. The image_tag
Liquid filter accepts an alt parameter, so a theme developer can pass an empty value for
section backgrounds. Check apps too: badge and trust-seal apps frequently inject small images with generic
alt values.
Page builders
Elementor, Divi and similar builders let you set images either as an image widget or as a section background. Prefer the background option for ornaments, and check the output, because some builders add wrapper images or placeholder GIFs of their own.
React and other frameworks
Icon libraries such as those used with React usually render inline SVG. Most set aria-hidden="true"
by default when no title is passed, but confirm it in the rendered HTML rather than assuming. In JSX,
write alt="" explicitly; omitting the prop produces an image with no alt attribute, and
linters such as eslint-plugin-jsx-a11y will flag it.
Edge cases
- Images of text used as decoration. A heading rendered as a picture of stylised lettering is not decorative, because it carries words. Replace it with real text and a web font, or give it alt text that matches the words exactly.
- Adjacent image and text link to the same page. On card layouts where the photo and
the title both link to the same article, wrap both in one link, or give the image link
alt=""withtabindex="-1"andaria-hidden="true"on the duplicate link so keyboard and screen reader users meet it once. - Emoji used as bullets or decoration. Screen readers read emoji names aloud. Wrap
decorative emoji in a
spanwitharia-hidden="true". - Animated decorative images. A looping GIF behind a banner is heavy and can distract.
Replace it with a short muted video or a CSS animation, and respect
prefers-reduced-motion. - Images you want in Google Images. If a photo is decorative on the page but you still
want it discoverable in image search, keep it as an
img. CSS backgrounds are not indexed as images.
Keeping decoration light and silent
- Put ornaments in the design system. Define dividers, textures and icon styles once in CSS or as components, so editors never upload them as images.
- Give editors a decorative switch. Where your CMS allows it, make "decorative" an explicit choice when inserting an image, rather than leaving an empty alt field that could mean either "forgot" or "decorative".
- Use one icon sprite. Keep all interface icons in a single SVG sprite with
aria-hiddenapplied by the component. - Lint the templates. Accessibility linters and automated checks catch missing alt attributes and focusable hidden elements before release.
- Re-audit after redesigns. Ornaments multiply every time a page is redesigned. Run the Image Optimisation audit on your key templates after each change.
1. How do I know if an image is decorative or not?
Ask what a visitor would lose if the image disappeared and left an empty space. If they would lose a fact, an instruction, a product detail or the ability to click something, it is content or functional and needs a description. If they would only lose some atmosphere, it is decorative. Judge in context: the same photograph can be ornament on one page and essential on another, depending on whether the surrounding text already covers what it shows.
2. Is it better to use alt="" or a CSS background for decorative images?
Both hide the image from screen readers, so the choice is mostly about performance and maintenance. CSS backgrounds keep ornaments out of the HTML, load after content images, and are usually skipped when their element is hidden. An img with empty alt is easier for editors to manage in a CMS and can be lazy-loaded natively. For theme ornaments prefer CSS; for images editors place in content, an img with empty alt is fine.
3. Does aria-hidden work on img elements?
It does hide an img from assistive technology, but it is the wrong tool for that job. An empty alt attribute is simpler, better supported and is what accessibility guidance recommends for decorative images. Keep aria-hidden for inline SVG icons, icon font elements and wrappers that contain only decoration. Never use it on anything that contains a link, button or form field, because keyboard users could still reach those controls while screen reader users would not know they exist.
4. Will decorative images with empty alt hurt my SEO?
No. Empty alt on a genuinely decorative image is correct markup and search engines do not penalise it. The image simply contributes nothing to understanding the page, which is accurate. What can hurt is filling decorative alt attributes with keywords, which makes the page worse for screen reader users and has no clear benefit. Put your effort into good descriptions for product photos, charts and other images that carry real information, where alt text matters.
5. Why does my audit still flag images I have marked as decorative?
Check the rendered HTML, not the editor. A common cause is alt with a space between the quotes, or a CMS that replaces an empty field with the file name or post title on output. Another is a plugin or page builder that adds its own wrapper image. Findings about file size, format or dimensions are separate from alt text, so a decorative image can still be flagged for being heavier than it needs to be.
6. Can a decorative hero image affect Largest Contentful Paint?
Yes. LCP measures the largest image or text block visible when the page loads, regardless of whether it carries meaning. A full-width background photograph behind the headline is often that element. If you move it into CSS, the browser finds it later and LCP can get slower. Keep it as an img with empty alt and high fetch priority, or preload it, and make sure the file is compressed and sized for the screen.
7. Should social media and payment icons in the footer have alt text?
It depends on whether they are links. A row of social icons that link to your profiles are functional, so each link needs a name such as the network name, given through the image alt or an aria-label on the link. Payment logos that are not links are usually decorative when a line of text already says which payment methods you accept; if no text says so, they carry information and need short descriptions.
The Image Optimisation audit checks every image on your page for file size, format, dimensions, alt text, lazy-loading, layout shift and CDN delivery, and ranks its recommendations by their effect on loading and bandwidth.
Open Image Optimisation Fixes โ