Skip to content

Commit e7e7e9a

Browse files
author
Walle Cyril
committed
saved picture element
1 parent 42ba509 commit e7e7e9a

1 file changed

Lines changed: 16 additions & 28 deletions

File tree

html/picture-element.md

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,18 @@
1-
<!doctype html>
2-
<html lang="en">
3-
<head>
4-
<meta charset="utf-8">
5-
<title>html boilerplate</title>
6-
7-
<!-- style -->
8-
<link rel="icon" href="icon.png">
9-
<meta name="viewport" content="width=device-width">
10-
<link rel="stylesheet" href="css/normalize.css">
11-
<link rel="stylesheet" href="css/examples/demo.css">
12-
13-
<!-- install -->
14-
<link rel="manifest" href="manifest.webmanifest">
15-
<meta name="msapplication-TileColor" content="#123456">
16-
<meta name="msapplication-square150x150logo" content="images/icons/150.png">
17-
<meta name="apple-mobile-web-app-capable" content="yes">
18-
<meta name="mobile-web-app-capable" content="yes">
19-
20-
<!-- prerender -->
21-
<link rel="prerender" href="x.html">
22-
</head>
23-
<body>
1+
# `<picture>`
242

25-
<p>Drink water</p>
26-
3+
## Use case
274

28-
<script src="bundle.js"></script>
29-
</body>
30-
</html>
5+
Provide the user-agent many image options, letting it decide the one that fits best.
6+
7+
An example where a high resolution image will be downloaded (and used) on wide enough devices.
8+
9+
```
10+
<picture class="">
11+
<source srcset="image-high-resolution.jpg" media="(min-width: 992px)">
12+
<img class="" src="image-low-resolution.jpg" alt="">
13+
</picture>
14+
```
15+
16+
## Fallback
17+
18+
In case the element is not supported the <img> inside will always be used.

0 commit comments

Comments
 (0)