I have been using the following markup for a while:
<img src="lowresImage.jpg" srcset="lowresImage.jpg, highresImage.jpg 2x" alt="Lorem Ipsum">
This works quite perfectly with picturefill (http://scottjehl.github.io/picturefill/) and doesn't give any cross-client issues.
I was just wondering if anyone can confirm that this is valid markup to support the use of inline retina images. I use this for the following reasons:
- The image is part of the content, so no background image can be used.
- Google does not index the srcset-attribute, but it does index the src-attribute, which is why I use both. So this is mainly an SEO consideration.
- As far as I have tested this, I haven't found the browser sending double HTTP-requests. It requests the src-image on normal desktops and the srcset-retina (2x) image on retina displays.
I can hardly find any info on the use of src together with srcset and picturefill in relation to SEO and retina-display. So if there are no flaws in this markup, then I hope more people can use this approach to responsive and SEO-friendly images.