As you can see in the handy reference image provided by Google, the browser will only draw the first few elements and then ignore the rest until it’s used.
The web continues to advance forward and like a few other convenient CSS properties such as native image lazy loading, Google have once against shipped a new feature which I am hopeful will make it into other browsers shortly called content-visibility which is part of the CSS Containment Specification.
The crux of this new property is you can tell the browser to ignore rendering of certain elements that are off-screen. Traditionally, when you load a webpage, it will draw it from top to bottom (regardless of what is visible and what isn’t), this is why virtualisation techniques are popular (especially for long grids).
As you can see in the handy reference image provided by Google, the browser will only draw the first few elements and then ignore the rest until it’s used. Rendering time is significantly reduced and therefore, increases your first paint as well as load time by a huge factor.
A good use-case for content visibility is a feed. Think of a site like Pinterest or application like Instagram which shows a few images above-the-fold, but a bunch more below-the-fold. Why should the browser rendering everything, especially if the user doesn’t scroll beyond what is visible? (maybe they click the first item they see).
Perhaps one of the coolest and most exciting features of this property besides speeding up initial render of your applications astronomically is being able to use it for hidden elements. Think of it as display: none;
on steroids by being able to specify content-visibility: hidden
which will hide the element and preserve its rendering state, if there are any changes that need to happen, they’ll only happen if the element is visible.
Want to develop a website or re-design using CSS Development? We build a website and we implemented CSS successfully if you are planning to **[Hire CSS Developer](https://hourlydeveloper.io/hire-dedicated-css-developer/ "Hire CSS Developer")**...
The other day one of our students asked about possibility of having a CSS cheatsheet to help to decide on the best suited approach when doing this or that layout.
Vue CSS frameworks are great for many reasons; code is more universally understood, web applications are easier to maintain, and prototyping becomes less of an extra step.
whats the variable in CSS, how to declare use them. Whats the benefit of variables in CSS. Lets learn all this. #Variables #CSS #HTML #CssVariables #ITArticles
Every element of HTML is a rectangular box. Every Box has a defined height and width. This way you can increase or decrease its size.