A long page may contain substantial content that starts well below the screen. The browser can spend time laying out and painting those sections before the reader reaches them. CSS content-visibility: auto lets the browser skip some of that rendering work when content is not currently relevant to the user.
This is a rendering optimisation, not a method for deleting text from the document. It also does not automatically prevent images, scripts or other resources from being downloaded.
Reserve space for the skipped section
The MDN content-visibility reference explains the property’s behaviour. A common companion is an intrinsic-size estimate, so a skipped section does not behave as though its contents occupy no space.
.long-section {
content-visibility: auto;
contain-intrinsic-size: auto 600px;
}
Here, 600 pixels is an illustrative estimate, not a universal recommendation. The auto component can allow a previously rendered size to be remembered. MDN’s intrinsic-size reference describes the sizing behaviour in more detail.
Choose meaningful sections rather than applying the rule indiscriminately to every small element. A product guide with several substantial chapters is a more useful experiment than a page of three short paragraphs. The estimate should reflect the likely section size at the tested viewport.
Measure the experience that actually changes
Compare the same page with and without the rule using browser performance tools. Keep the device, viewport and content consistent. Look at rendering work and scrolling behaviour, not only the transferred file size, which this property does not directly reduce.
Off-screen content using auto remains in the DOM and accessibility tree. Test keyboard navigation, browser find, anchor links and assistive-technology behaviour. MDN also notes subtleties involving descendants intended to be hidden; an optimisation should not expose confusing content to a screen reader.
Check what happens when a skipped section becomes visible. Large changes from the estimated size can disturb the page’s apparent position. Adjust the section boundaries or estimate based on observations rather than keeping a copied value.
Finally, test the browsers your audience uses. A feature can be supported without improving every page. Retain it when measurement shows a useful reduction in work and the full reading experience remains dependable.

