Skip Navigation

[Resolved] Image elements do not have explicit width and height

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 15:00 7:00 – 15:00 7:00 – 15:00 7:00 – 15:00 7:00 – 15:00 -
- - - - - - -

Supporter timezone: Pacific/Easter (GMT-05:00)

This topic contains 6 replies, has 2 voices.

Last updated by Ilyes 6 months, 3 weeks ago.

Assisted by: Ilyes.

Author
Posts
#2692988
image.JPG

I use dynamic images on hidden link

For speed optimalisation I want to give the image elements a width and height.
I do it like attached but I still got the message: Image elements do not have explicit width and height

How can I give them a explicit width and height?

#2693265

Ilyes
Supporter

Timezone: Pacific/Easter (GMT-05:00)

Hello,

Thank you for contacting WPML support team,

Could you please let me know if the notice still displays if you choose this option : hidden link

I assume Setting explicit width and heights can help the browser to reserve the appropriate space, so that your page does not experience bad layout shifts or appear broken to users. Additionally, this helps reduce the main thread work the browser must process and helps with a smoother overall experience. In that case, the second option should work.

If not, could you please tell me where you are seeing this notice? What plugin/interface shows it?

Best,

#2693823

Hi Ilyes,

I have adjusted this but the message remains, Image elements do not have explicit width and height.
I use images URL like this:
hidden link

hidden link
Image elements do not have explicit width and height

#2694434

Ilyes
Supporter

Timezone: Pacific/Easter (GMT-05:00)

Hello,

Thank you for your patience,

I could not find any past forums talking about this issue and I can't seem to replicate it on a clean version,

I have created the sandbox below where you could access and try replicating the issue there, could you please create a block with an image there and upload the images there. Try applying the explicit image there and see if the issue replicates :

hidden link

Thank you for your cooperation,

Best,

#2694809

Hello,

The best way is to login on my webshop because the import is done via WP all import.
And it is quite a lot of work to duplicate it differently.

#2694978

Ilyes
Supporter

Timezone: Pacific/Easter (GMT-05:00)

Hello,

I would like to ask for temporary access to your test site’s wp-admin and FTP to investigate the issue further.

Kindly provide me with the steps on how to replicate the problem.

It is important to note that you should back up your site and database before proceeding, and you can use a plugin like Duplicator for this purpose. Here’s a link to the plugin: http://wordpress.org/plugins/duplicator/

For your privacy and security, please ensure that you make your access is shared through the form below.

Best regards,

#2696475

Ilyes
Supporter

Timezone: Pacific/Easter (GMT-05:00)

Hello,

Thank you for your patience,

If we take this picture as an example: hidden link

The image paths on the page (cdn-cgi) suggest a third-party CDN service is in use for image delivery. I suggest to test with that service disabled to see if that makes a difference.

If that did not help, overall, there are two common ways to solve this, though one of them isn’t an actual solution:

1. Leave it as is since it doesn’t affect the scores too much and isn’t a major issue.

2. Redo the CSS/HTML to provide static image sizes, for example, you could do something like:

hidden link

Best,

#2697105

Thanks Ilyes