Advertisement
Guest User

Resolution switching: Same size, different resolutions

a guest
Apr 12th, 2018
328
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.54 KB | None | 0 0
  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):
  2.  
  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">
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement