Sets the image size using the img div class in the same way as the img class

An attempt to speed up the work of my site, and I am in the given image sizes to avoid rearrangement and reviews.

If I have images in a div with <div class="class"> .class img {height: xxxpx; width: xxxpx;} <div class="class"> .class img {height: xxxpx; width: xxxpx;}

Wouldn't that be the same as setting dimensions inside <img class="class"> .class {height: xxxpx; width: xxxpx;} <img class="class"> .class {height: xxxpx; width: xxxpx;} ?

Just wondering if it works the same as im, getting a warning about image sizes in gtmetrix.

+5
source share
1 answer

Yes, this is the same. And you can ignore the warning from gtmetrix.

http://gtmetrix.com/specify-image-dimensions.html

Currently, page speed determines only measured image sizes through image attributes. If you specify the dimensions through CSS, then you can safely ignore this recommendation.

+2
source

All Articles