Image elements do not have explicit width and height

Posted in: Newspaper
Post count: 155

In lighthouse audits, I am facing a problem with some images:
The report says that “Image elements do not have explicit width and height: set an explicit width and height on image elements to reduce layout shifts and improve CLS”

How can I do this?

Post count: 35449

Hi josp, please provide some more details about those images, where there are set (posts, pages) and what you use to set theme. For example if you use tagdiv Composer and single image element, you can set those proprieties with those options -> https://i.imgur.com/GBGDXsd.jpg
Hope this will help you!

Post count: 155

Hello, Calin.

The images are showing the same location:
img.tdb-logo-img.td-retina-data.td-retina-version

Thy are located in the header for main and mobile.
I wasn’t able to find the height and width for this images.

Post count: 35449

Hi,
Using tagDiv Composer, you can select the mobile view post, select the logo and set the with from here -> https://i.imgur.com/ywvpUhP.png if there is still a problem with the td-retina-version in lighthouse, please remove the retina logo, clear all cache and check again, is possible that some setting or options to be understand different on lighthouse.
Let me know the results!

Post count: 155

Hello,

Tried to do that, but there is no place in the logo block to set the height of the image, only the width.. so the lighthouse keeps warning me about it.

More on that, I followed your suggestion to remove the retina logo (in the theme panel and in the block itself), and lighthouse now put the error in this location:
img.tdb-logo-img

Is there no way to set the image height?

Post count: 35449

Hi josp, unfortunately the logo do not have the height, only the image elements has the both options -> https://i.imgur.com/IYgTEVs.png
Thank you for your understanding!

Post count: 155

Ok. I think that is a terrible mistake (but a very easy one to adjust).
Hoping that in a (near) future update that error is gonna be fixed.

Thanks for the help.

Post count: 155

Hi, again!

I noted that my website is loading 2-3 images in base64, like this one reported by Google: https://paste.pics/BR7LQ

Is the Newspaper theme inserting it?

Post count: 18283

Hello !

That does not look like a Newspaper Theme image. My recommandation is to look for the image in your cpanel and see exactly what that image contains.

Thank you !

Post count: 155

Hi, Vlad!

That image is not loaded from a server, but it is encoded in base64.

But i’ll try to find where does it come from.

Thanks for the info!

Viewing 10 posts - 1 through 10 (of 10 total)
The forum ‘Newspaper’ is closed to new topics and replies.