Note from 26 May 2021
This is a lovely way to deal with image crop and focal point with CSS only! 😍 And I love that Johannes put this warning in the beginning: While client-side…
Apparently, an image whose part above the fold is indeed the largest, but of which only a small part can be seen, can be considered an LCP element, even if another image has a larger part visible... 😭
You can see this for my photography site in this WebPageTest result:
In our case, we were using
ch units to define our page layout. This meant that our post content was equal to
50ch units (or the width of fifty…
Do you know good tutorials and/or examples about dealing with responsive images that are fluid horizontaly, but with a fixed height?
object-fit: cover; in the CSS is easy, but how can we prevent loading many pixels that will be hidden, without using too many
<source> in a
Limiting the image density on mobile devices drasticaly improves performance, with no visual loss, so we did it!
I still wish it was much easier than dealing with
x descriptors for fluid images… 😞
<img maxdensity="2.5" …> attribute for example!
If you agree, comment: