cssimageclient-hints

How does CSS resize images?


Let's say I have a image that's 1240x720 and I resize it to 1240x250 with CSS using height and width. I access my site and have to download it but, do I download the original one (1240x720) that then is resized on my browser or the already resized version (1240x250)?

From googling I can only find posts where people explain how to use it so this might be a really dumb question as it's not even mentioned anywhere..


Solution

  • The browser will download whatever the URL points to.

    If the height and width of the <img> don't match the dimensions of the image, it will be scaled to fit.