1

I analyzed my website on Gtmetrix.com for optimization and the result was this:

The following image(s) are missing width and/or height attributes:

http://mywebsite.com/media/catalog/product/cache/1/small_image/168x168/9df78eab33525d08d6e5fb8d27136e95/1/1/11.jpg
(Dimensions: 168 x 168)
http://mywebsite.com/media/catalog/product/cache/1/small_image/168x168/9df78eab33525d08d6e5fb8d27136e95/1/1/11_1.jpg
(Dimensions: 168 x 168)

Specify image dimensions

allows for faster rendering by eliminating the need for unnecessary reflows and repaints.Specifying a width and height for all images

how to solve it?

1

Look in your templates for <img> tags and where you find one that you are sure it has some fixed size, just add width=".." height=".." on it.

For sections where the product images are displayed (product list, view, related, upsells, crosssels, cart, wishlist) you should know the size because most of them have a resize.
In your case think there is something like ->resize(168) or ->resize(168, 168).
this means you have to add this to your img tag: width="168" height="168"

0
2

Any img tag use like this. its works grt just check out.

<img width="236" height="193" src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image') ?>"  alt="<?php echo $this->htmlEscape($_product->getName()) ?>" />

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.