Typically when working on responsive or mobile-first design, media queries are utilized to deliver different CSS styles based on screen size.
An optimal design strategy may involve not including any images in the default (small) resolution layout.
While using background-image
in CSS makes it simple to achieve this, it seems challenging to implement for semantic <img>
tags.
- Is it possible to accomplish this with HTML alone?
- Is it considered good practice to use CSS exclusively for handling images?
Personally, I prefer a design with no images by default for small screens, but I find it unappealing to have no images for desktop-only versions that lack CSS.
Please note: Solutions involving JavaScript are not viable options.