I'm trying to optimize my images for SEO.
Page Speed currently only detects image dimensions that are specified via the image attributes.
According to above line i should use width
and height
attribute in image tag for improving the page speed. But I have to responsive the site also, for example i have an image with following width and height.
Screen Size 960 pixel
<img src="" width="250" height="250" />
Then how i will adjust the image size on small screens?
Screen Size 480 pixel
<img src="" width="250" height="250" />
if i add an id or class for adjusting the size on the small screen the it will be correct way or not?
.reduceSize{
width:150px;
height:150px;
}
Please guide me i'm wrong or any other suggestion. Also in image tag width and height attribute are necessary for site speed ?