Archived topic
Mobile Logo: Image Elements Do Not Have Explicit Width & Height
6 replies · Started by Sankalan on February 21, 2021
Hi,
I am currently working on my staging site and checked it with Google PageSpeed Insights and found the warning:
Image Elements Do Not Have Explicit Width & Height.
I have two different logos - one for desktop and other for mobile.
This warning is showing up for mobile logo only. I did set the width for the logo in Site Identity settings, but that seems to work only for the desktop logo.
How to fix this issue?
I think I found the solution to the problem in this forum topic: https://generatepress.com/forums/topic/how-to-set-height-and-width-for-the-logo-image/#post-1563234
It just worked. Please ignore the question. In case I find another issue, I will come back with a question.
Glad to hear you found the solution.
To note - its not actually required, as the logos height is defined by the Menu Item Height - so the absence of any w/h attributes won't affect its display.
It won't impact display, but it definitely caused CLS. The moment I added the code, CLS issue was gone.
thats because the image is being lazy loaded. We recommend you exclude logos from lazyloading by using the CSS Class: is-logo-image in the plugins exclusion field
Thank you David. I will implement it and get back to you on this.
You're welcome