Last active
December 15, 2015 21:49
-
-
Save felipemorais/5328258 to your computer and use it in GitHub Desktop.
Responsive Image solutions
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
#srcset - http://www.w3.org/html/wg/drafts/srcset/w3c-srcset/ | |
<img alt="The Breakfast Combo" | |
src="banner.jpeg" | |
srcset="banner-HD.jpeg 2x, banner-phone.jpeg 100w, banner-phone-HD.jpeg 100w 2x"> | |
#picture tag - http://picture.responsiveimages.org/ | |
<picture id="pictureElement"> | |
<source media="(min-width: 45em)" srcset="large-1.jpg 1x, large-2.jpg 2x"> | |
<source media="(min-width: 18em)" srcset="med-1.jpg 1x, med-2.jpg 2x"> | |
<!-- assume media all --> | |
<source srcset="small-1.jpg 1x, small-2.jpg 2x"> | |
<!-- the following are ignored --> | |
<source media=" is the message " srcset=""> | |
</picture> | |
#Server side like sencha.io - http://www.sencha.com/learn/how-to-use-src-sencha-io/ | |
<img | |
src='http://src.sencha.io/x50r20/http://sencha.com/files/u.jpg' | |
alt='Half the screen, rounded down to nearest 20 pixels' | |
/> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment