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

That would require you know all image urls ahead of time and include them in your css file. For something like a blog or a site with user uploaded content you'd be getting the image url from your database when generating the page.



You can still make responsive images without using them as a background. Just set the CSS width property to 100% of its parent and the height property to auto. The problem is you can certainly over-scale if the parent container's width is larger than the image's.


Agreed. Was responding to the top comment in this thread about why one might want to use an image tag instead of background-image.




Applications are open for YC Winter 2019

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

Search: