HTML & CSS · Senior · Question 8 of 75

How does content-visibility: auto speed up long pages?

Explanation

The browser doesn't render sections outside the viewport, saving time on the first paint. To keep the scrollbar from jumping, set an expected size via contain-intrinsic-size: auto 500px. The DOM stays intact: find-in-page and accessibility keep working, unlike virtualization.

Further reading

Problem with a question

HTML & CSS · Senior · question 8

Test yourself

Take the HTML & CSS · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz