Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Ok, my image has 100% width for screens up to 800 px width, what height value do I have to set? You simply don't know this information at the time when the DOM is built.

The idea to set fixed dimensions feels like it comes from a time where we did designs with tables and "optimized" sites for 1024 x 768 pixel screen size.

That was the time when you could tell that this image should be displayed 200 x 200 px in size and nothing else. And it fit. One way or another.



I would approach this thinking in terms of a known aspect ratio of the images and use a technique like this:

https://www.w3schools.com/howto/tryit.asp?filename=tryhow_cs...

Make no mistake, this is a silly problem to need to hack a solution for. So I would welcome lazy loaded images with space allocation before it's rendered with a responsive sizing.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: