Answer the question
In order to leave comments, you need to log in
Responsive image so it is possible?
Is this a good solution for responsive images?
What pitfalls can be encountered with this method?
https://jsfiddle.net/f6y2n2rh/
or is it better to replace src via js?
Answer the question
In order to leave comments, you need to log in
Есть еще srcset. Вот тут можно почитать.
Поддержка браузерами
You can also use css, but then you have to make two img blocks and set display: block/none via media.
Solution - https://jsfiddle.net/f6y2n2rh/3/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question