Hi,
through lighthouse reports, google encourage developers and webmasters to specifically add width and height of images. The problem comes when adding an image through the admin text editor.
The image is added this way: ![my-image-alt](image-name.svg "my-image-title")
I can add the width through an attribute: ![my-image-alt](image-name.svg?attribute=width,27 "my-image-title")
This works fine
But the “height”… how can I add the height?
I tried using “&” but it is not working: ![my-image-alt](image-name.svg?attribute=width,27&attribute=height,27 "my-image-title")
@anon76427325 , thank you very much for your reply and for giving a solution. It worked fine thanks.
Activating CLS (Enable Auto Sizes) through the Configuration automatically adds width and height to all images, if it is disabled then width and height can be added individually using ?autoSizes=true in the desired image. Perfect!
The only thing I noticed is that this works fine for .jpg and .png images, it doesn’t gives sizes to .svg images. Replacing .svg images will do the job.