October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk5 min

CSS content-visibility: How to Improve Page Rendering Performance

Use content-visibility: auto on substantial offscreen sections to defer rendering work. Pair it with contain-intrinsic-size and test layout, accessibility, browser support, and real performance gains.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

CSS content-visibility: auto can reduce the browser’s initial rendering work on long pages by letting it skip layout and painting for substantial offscreen sections until they become relevant. Pair it with contain-intrinsic-size to reserve space for those sections, then measure the result on your own page: the often-cited 7× gain came from a specific web.dev demonstration, not a general guarantee.

What content-visibility does—and what it does not do

The content-visibility property controls whether an element’s contents are rendered. With auto, the browser may skip rendering work—including layout and painting—for offscreen content, and perform that work when the content becomes relevant. This can help on pages with large amounts of content that a visitor does not initially see.

It does not remove markup from the DOM, reduce the page’s network transfer, or generally replace work to reduce JavaScript execution. Its benefit is specifically about rendering work. Use it on sizable, meaningful chunks such as independent article sections rather than indiscriminately applying it to every node.

How to apply it safely

Start with substantial offscreen sections

Apply content-visibility: auto to section-level elements whose contents are expensive to render and likely to start below the fold. Keep the chunks meaningful and independent. Code that calls DOM APIs and forces a skipped subtree to render can undermine the optimization, so review code that measures or manipulates those sections.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Reserve plausible space

.article-section {
  content-visibility: auto;
  contain-intrinsic-size: auto 500px;
}

The 500px value is illustrative, not a recommended universal size. contain-intrinsic-size gives the browser a placeholder size while size containment is active. With auto 500px, the browser can use a remembered rendered size when available and the supplied fallback otherwise. Choose a fallback close to the section’s normal size, then check scroll position and layout as sections render. A poor estimate can make the page’s reserved space differ noticeably from the rendered content.

Understand skipped-state behavior

MDN’s containment guidance describes skipped contents as having layout, style, paint, and size containment: they are not painted and do not receive pointer events while skipped. The auto value can still allow content to be searched and focused, and the browser can make it relevant and render it. Do not confuse auto with hidden; they have different behavior.

Accessibility and application behavior

Content in an auto-contained offscreen section remains in the DOM and accessibility tree. This can preserve access to content, searching, and focus navigation. There is an important edge case: because styles for skipped content have not been rendered, descendants intended to be removed from the accessibility tree using display: none or visibility: hidden may still appear there before the section becomes relevant. If content must be absent from the accessibility tree, web.dev advises using aria-hidden="true". Use that only when it matches the intended semantics, and verify behavior with assistive technology.

For elements using auto, the contentvisibilityautostatechange event lets application code respond when the browser starts or stops skipping an element. For example, code that draws into a canvas can use the event to stop unnecessary drawing while the element is skipped and resume when rendering is needed.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Measure the gain on your page

web.dev reported a 7× rendering performance boost on initial load in its 2020 demonstration after applying content-visibility: auto to chunked content areas. That is a result for that demonstration—not a controlled universal estimate or a forecast for another site.

Your result depends on how much expensive rendering work is initially offscreen and whether application code forces the browser to render skipped content. Compare before and after on representative pages and devices. Check the initial rendering and interaction cost, how sections affect layout as they appear, and whether the behavior remains accessible and usable for your audience. Use browser diagnostics where available to investigate unexpected work or layout changes.

Browser support

MDN labels content-visibility Baseline Newly available since September 2024. A later web.dev announcement says it became available across all three major browser engines as of September 15, 2025. These milestones indicate broad availability in current engines, not guaranteed support on older browser versions or devices. Check the compatibility data against the browsers your audience actually uses before depending on the property.

Troubleshooting common problems

  • Little or no performance improvement: The page may have little expensive offscreen rendering work, or code may be forcing skipped subtrees to render. Apply the property to substantial offscreen chunks, then inspect the page’s rendering behavior and relevant DOM-measuring code.
  • Scroll position or spacing changes as content appears: The intrinsic-size fallback may not resemble the section’s normal size. Adjust the fallback using representative sections and recheck the page as content renders.
  • Hidden descendants are exposed to assistive technology: Styles such as display: none or visibility: hidden may not have taken effect for skipped content. Where the semantics require exclusion from the accessibility tree, consider aria-hidden="true" and verify with assistive technology.
  • Older browsers do not behave as expected: Broad current-engine availability does not ensure support on older clients. Check the browser compatibility table and test the versions and devices you support.
  • Canvas or other application work continues while offscreen: Use contentvisibilityautostatechange where appropriate to stop work while the browser skips the element and resume it when the element becomes relevant.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If you need a screenshot of a page rather than a CSS optimization, ScreenshotNeo is a website screenshot API and MCP server. Its API can return a screenshot or PDF from one GET request; it does not implement or measure content-visibility performance.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For example, with cURL (see the API documentation):

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

ScreenshotNeo accepts cookie and consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, with the page verdict and billing status included in response headers. An MCP server provides take_screenshot, get_page_info, and capture_pdf for AI agents and MCP clients. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots.

Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.