Created
July 28, 2016 15:22
-
-
Save woodphil/0ee359f94ae4a5545a04a20cca7c1c51 to your computer and use it in GitHub Desktop.
img srcset example and comments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<img id="first-outfit" | |
srcset="small.jpg 300w, | |
large.jpg 1024w" | |
sizes="(min-width: 768px) 90vw, 100vw" | |
src="medium.jpg" | |
alt="first outfit" /> | |
<!-- srcset defines the image sources and their dimensions --> | |
<!-- sizes defines the breakpoints and what the expected displays are at that break point, no media query is the default value--> | |
<!-- src is the default image when the queries aren't suitably matched/browser does not support srcset --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment