Reference guide · images · Published 2026-08-16 · 3 min read

content-visibility versus loading lazy for images

content-visibility vs loading lazy for images: how each defers work, the CLS risk, and when to combine or choose between them.

Flat editorial illustration showing layered photo frames with a visible file-size meter and a compression bar, grid of thumbnails receding.
Illustration: this article at a glance.

Two techniques both make an image-heavy page faster by deferring work on images that sit below the fold, and they are easy to confuse because they touch the same elements. They solve different bottlenecks, so the useful question is not "which one" but "what am I trying to save".

Editorial close-up illustration showing layered photo frames with a visible file-size meter and a compression bar, grid of thumbnails receding.
Illustration: a closer look at the technique described above.

What each one does

loading="lazy" is a browser feature on <img> (and iframes) that defers the network fetch until the image approaches the viewport. Its win is bandwidth and request count: images far below the fold are not downloaded at all until the user scrolls near them. It does not change how the browser lays out or paints the document; it only delays the download and decode of the file. The lazy loading guide covers when it helps and how the browser's threshold decides the fetch.

content-visibility: auto is a CSS containment property that tells the browser to skip style, layout, and paint work for a section until it is near the viewport. Its win is rendering work on the main thread: a long page with many heavy sections spends its initial paint time recomputing layout and paint for sections nobody has reached yet, and the property skips that work. It does not by itself stop the image downloads, because an img inside still triggers a network request unless it also has loading="lazy". The content-visibility article explains the property and its intrinsic-sizing requirement.

The CLS risk in both

Either technique can introduce layout shift, because both defer work that changes the page size:

So both demand the same discipline: the element must reserve its footprint before the deferred work happens, or the deferral trades bytes and paint for a jumpy page.

Combine or choose

They are complementary rather than competing:

On a photo-heavy long page you often want both: content-visibility: auto on each heavy section plus loading="lazy" on the images inside. The hero image is the exception and should stay eager and high-priority, because it is the LCP and benefits from the hero optimisation and LCP techniques rather than deferral. Apply the pair to the below-fold tail and keep the critical path eager, which is the framing the content-visibility article and the lazy loading guide each make from their side.

Need a website built, fixed, optimised, migrated or replaced?

This technical resource is written by CSMBAC, a small design and development studio. If you would rather hand the problem to a professional, the website service page explains how we build enquiry-ready websites.

Explore website services