Resolution switching: Same size, different resolutions

a guest Apr 12th, 2018 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. If you're supporting multiple display resolutions, but everyone sees your image at the same real-world size on the screen, you can allow the browser to choose an appropriate resolution image by using srcset with x-descriptors and without sizes — a somewhat easier syntax! You can find an example of what this looks like in srcset-resolutions.html (see also the source code):
  3. <img srcset="elva-fairy-320w.jpg,
  4.             elva-fairy-480w.jpg 1.5x,
  5.             elva-fairy-640w.jpg 2x"
  6.     src="elva-fairy-640w.jpg" alt="Elva dressed as a fairy">
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand