Created
March 12, 2015 08:35
-
-
Save okuniw/b61dff6cdd95b5f4d54b to your computer and use it in GitHub Desktop.
html5 picture tag test
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
</head> | |
<body> | |
<picture alt="description"> | |
<!-- request image based on browser's width --> | |
<source srcset="big.jpg" media="(min-width: 800px)"> | |
<source srcset="medium.jpg" media="(min-width: 400px)"> | |
<source srcset="small.png"> | |
<!-- img tag for browsers that do not support picture element --> | |
<img src="medium.jpg" alt="default picture"> | |
</picture> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment