For a web app of mine, I want images served to the user to be responsive. Moreover, I'd also want to specify width
and height
attributes in the image tag, so that over slow mobile connection, there's no browser reflow.
Are both of these requirements achievable via using pure HTML?
If it's indeed possible, an illustrative answer that shows working examples is most welcome. Secondary pure JS (no libraries) answers are welcome too (but my primary focus is doing this via lightweight HTML).
Note: this accepted answer from a similar question relies on JQuery (something I'm not versed in), hence doesn't meet my requirement.
Background: for mobile-responsive design it's common to specify a width (or max-width), and define height as auto
. That would clash with (and be antithetical to) width
and height
values. Hence my question.