Hi, I have a div with an image that shows on mobile but not on large screens. Even though I’m not displaying the image on large screens, the image still loads, which I understand. To help mitigate the load time for that image on large screens, I deferred the image loading which works perfectly.
Here is the HTML:
<img class="samplepic2" src="data:image/png;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=" alt="Sample" data-src="http://www.modovis.com/wp-content/uploads/2016/01/CHAIR1-1.jpg" />
Here is the result on mobile which looks perfect:
I now want to reduce the image load time on large screens even further by not only deferring the image load, but only loading a data image in its place on large screens 1x pixel ratio and leaving the full image on mobile 2x pixel ratio. Below is my HTML for which I attempted and then the result.
Html:
<img class="samplepic2" src="data:image/png;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=" srcset="data:image/png;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs 1x, data:image/png;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs 2x" alt="Discovery" width="110" height="110" data-srcset="data:image/png;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs= 1x, http://www.modovis.com/wp-content/uploads/2016/01/CHAIR1-1.jpg 2x" data-src="http://www.modovis.com/wp-content/uploads/2016/01/CHAIR1-1.jpg" />
Result:
Why is the image small? Thank you for any insight.
My Page.