Improve page load performance and rendering time by utilizing the content-visibility CSS property. It allows the browser to skip rendering offscreen content until it's needed, resulting in faster initial load times and interactions with on-screen content. CSS containment provides predictable isolation of DOM subtrees, allowing for optimization decisions in page rendering. Using content-visibility: auto provides immediate performance improvements, while content-visibility: hidden hides the element's contents while preserving rendering state. These techniques can improve page responsiveness and reduce rendering work on the main thread.
Table of contents
Browser supportCSS ContainmentSkipping rendering work with content-visibilityA note on accessibilityExample: a travel blogHiding content with content-visibility: hiddenEffects on Interaction to Next Paint (INP)ConclusionSort: