Reputation:
I have some images in my web which linked from image hosting sites. All the images require 100% in width.
However, some images have extremely large pixel and therefore load slow.
How I can set the style to reduce the pixel of images while keep the images in 100% width in order to load faster?
For example, fix the horizontal pixel to 1440px and adjust the vertical pixel and keep it in 100% width?
Upvotes: 1
Views: 495
Reputation: 9273
You have very little control over an image that is hosted elsewhere. Some alternate ideas:
<picture>
tag to specify a different image based on screen size: load images using the picture tagUpvotes: 1
Reputation: 505
you need to have 2 versions of each image, one with the original size and you can use this when user request to download the photo, and the other for the display and the UI, this will make your page load faster and less data bandwidth.
Upvotes: 1