Skip to content

Instantly share code, notes, and snippets.

@Wilto

Wilto/comparison Secret

Last active December 25, 2015 21:59
Show Gist options
  • Save Wilto/27d6925e8c1a71a87a03 to your computer and use it in GitHub Desktop.
Save Wilto/27d6925e8c1a71a87a03 to your computer and use it in GitHub Desktop.
<picture>
<source media="(min-width: 800px)" srcset="pic-big.jpg 1x, pic-big-hd.jpg 2x">
<source media="(min-width: 400px)" srcset="pic-med.jpg 1x, pic-med-hd.jpg 2x">
<img src="small.jpg" alt="…">
</picture>
<img
src-2="(min-width: 400px) pic-med.jpg 1x, pic-med-hd.jpg 2x"
src-1="(min-width: 800px) pic-big.jpg 1x, pic-big-hd.jpg 2x"
src="small.jpg"
alt="…">
@patik
Copy link

patik commented Oct 19, 2013

Suppose each image file has different content because of art direction — for example, the three images in this CSS Tricks article under the heading "Do I care about art direction?". If the change is drastic enough, you might need different alt values depending on which image has loaded.

Have you considering allowing for, er, alternate alt and title values?

@marcoscaceres
Copy link

@patik, if the change is that drastic, then the developer is doing img wrong.

@marcoscaceres
Copy link

@patik, to be clear, we don't want to introduce something new that would allow the developer to do what you describe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment