Obviously this is far from good but what's the practical solution for this?
As far as I know, doing this with HTML + CSS alone by yourself is tedious and error-prone e.g. figure out manually the maximum size of each image, generate all variations of the image sizes yourself, then use HTML/CSS to load the right ones.
There's CDN, web server and CMS specific solutions that dynamically resize + cache images on demand but they're far from common place so I'm not surprised most website owners don't do this well.