Hacker News new | past | comments | ask | show | jobs | submit login

Refusing to specify your image sizes denies the browser the information it needs to solve this problem.



Maybe, but I think this is a solvable problem from the browsers perspective. In my experience building websites the need for image dimensions is near zero.

1. The penalty for not displaying image dimensions is nearly insignificant because almost _all_ images that you would put width/height on are from content managers, not designers.

2. Mobile content: On a phone the content moves down after the image is loaded. (everything is just a single column) Which is a preferable action than a big empty space. So, I prefer _not_ including dimensions on user content for phones.

3. Responsive design: All CSS I have been using for years now has "max-width:100%".

Therefore (since a lot of traffic is mobile) most (rough guess) of images loaded from sites I've worked on the image dimensions are recalculated as soon as the image is loaded anyway.

4. Srcset: Multiple possible images downloaded that are _chosen_ by the browser at run time. You already have to provide dimensions. But what if they aren't exact? Go back to #1.

5. Web design: I can't even recall the last time I put an image in a design using the <img> tag that affected layout. (maybe if you go back to the 90s this would have mattered)




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

Search: