Archived topic
logo size problem
5 replies · Started by Shangxiao on July 11, 2022
Hi there,
One of my site's logo image doesn't have a size, which leads to CLS problem, could you help me with this.
https://www.screencast.com/t/EgDccZLCwII
Thanks.
Hi there,
your logos do have their size attributes, the issue is they are being lazyloaded. We advise you exclude the logos from lazyloading, most lazyloaders provide a field to Exclude images with a specific CSS Class. you can use: is-logo-image
it works, thanks David, but I found another strange question, some of my pages still have CLS problem, I checked in Lighthouse, it seems like the container problem, but some of my pages don't have this problem, that's strange, could you help me check this?
Thanks.
If i test any of those URLs with WP Rocket disabled ( by adding ?nowprocket to the end of the URL ) then the CLS drops to 0.
So one of the optimizations from WP Rocket is causing the CLS.
Its generally because of CSS Optimizations such as unused CSS. Or the Font Display options being set to swap. Try disabling each option to see which one(s) are the issue.
Thanks for your tips, I found the reason, and everything is ok now, thanks again my friend.
Glad to hear that!