forked from scottjehl/picturefill
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathindex.html
More file actions
47 lines (40 loc) · 2.2 KB
/
Copy pathindex.html
File metadata and controls
47 lines (40 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Picturefill</title>
<style>
body { font-family: sans-serif; margin:0; padding:0; }
img { max-width: 100% }
</style>
<script>if (!window.matchMedia) { document.write('<script src="src/external/matchmedia.js"><\/script>'); }</script>
<script async="true" src="src/picturefill.js"></script>
</head>
<body>
<h1>Picturefill: A <picture> element polyfill</h1>
<p>For more info: <a href="http://github.com/jansepar/picturefill">see project home.</a></p>
<p>Default example:</p>
<picture alt="A giant stone face at The Bayon temple in Angkor Thom, Cambodia">
<!-- Video tag needed in order to use <source> in IE9 -->
<!--[if IE 9]><video style="display: none;"><![endif]-->
<source srcset="examples/images/small.jpg"></source>
<source srcset="examples/images/medium.jpg" media="(min-width: 400px)"></source>
<source srcset="examples/images/large.jpg" media="(min-width: 800px)"></source>
<source srcset="examples/images/extralarge.jpg" media="(min-width: 1000px)"></source>
<!--[if IE 9]></video><![endif]-->
<!-- Fallback content for IE8 and older -->
<img data-picture-src="examples/images/small.jpg" alt="A giant stone face at The Bayon temple in Angkor Thom, Cambodia">
</picture>
<p>Example using "sizes" attribute:</p>
<picture alt="Obama with soldiers">
<!-- Video tag needed in order to use <source> in IE9 -->
<!--[if IE 9]><video style="display: none;"><![endif]-->
<source sizes="(max-width: 30em) 100%, (max-width: 50em) 75%, 50%"
srcset="examples/images/pic-small.png 400w, examples/images/pic-medium.png 800w, examples/images/pic-large.png 1200w"></source>
<!--[if IE 9]></video><![endif]-->
<!-- Fallback content for IE8 and older -->
<img data-picture-src="examples/images/pic-small.png" alt="Obama with soldiers">
</picture>
</body>
</html>