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

An <img> is a tag that finds space to fit an actual grid of pixels.

A <picture> is a responsive-aware tag that can several <source> of actual images (of different sizes), as well as an actual <img> for legacy browsers to still be able to render something.

The <picture> element was standardized with HTML5 so the browser can figure out what <source> is best for its resolution, network speed/cost...

This way mobile phones don't have to download fancy 4K backgrounds, and we don't have to use Javascript because it's part of the HTML spec.



Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: