@@ -6,9 +6,9 @@ Assuming three image “breakpoints” based on maximum widths, using pixel-base
6
6
** ` picture ` Element**
7
7
```
8
8
<picture>
9
- <source media="max-width: 400px" src="image1.jpg">
10
- <source media="max-width: 600px" src="image2.jpg">
11
- <source media="max-width: 800px" src="image3.jpg">
9
+ <source media="( max-width: 400px) " src="image1.jpg">
10
+ <source media="( max-width: 600px) " src="image2.jpg">
11
+ <source media="( max-width: 800px) " src="image3.jpg">
12
12
<img src="image1.jpg" alt="">
13
13
</picture>
14
14
```
@@ -25,9 +25,9 @@ Assuming three image “breakpoints” intended to remain in sync with a media-q
25
25
** ` picture ` Element**
26
26
```
27
27
<picture>
28
- <source media="min-width: 400px" src="image1.jpg">
29
- <source media="min-width: 600px" src="image2.jpg">
30
- <source media="min-width: 800px" src="image3.jpg">
28
+ <source media="( min-width: 400px) " src="image1.jpg">
29
+ <source media="( min-width: 600px) " src="image2.jpg">
30
+ <source media="( min-width: 800px) " src="image3.jpg">
31
31
<img src="image1.jpg" alt="">
32
32
</picture>
33
33
```
@@ -43,9 +43,9 @@ Assuming three image “breakpoints” intended to remain in sync with a media-q
43
43
** ` picture ` Element**
44
44
```
45
45
<picture>
46
- <source media="max-width: 20em" src="image1.jpg">
47
- <source media="max-width: 40em" src="image2.jpg">
48
- <source media="max-width: 60em" src="image3.jpg">
46
+ <source media="( max-width: 20em) " src="image1.jpg">
47
+ <source media="( max-width: 40em) " src="image2.jpg">
48
+ <source media="( max-width: 60em) " src="image3.jpg">
49
49
<img src="image1.jpg" alt="">
50
50
</picture>
51
51
```
@@ -69,8 +69,8 @@ Assuming the author simply wants to preform image source swapping based on a dev
69
69
70
70
```
71
71
<picture>
72
- <source media="device-orientation: portrait" src="image1.jpg">
73
- <source media="device-orientation: landscape" src="image2.jpg">
72
+ <source media="( device-orientation: portrait) " src="image1.jpg">
73
+ <source media="( device-orientation: landscape) " src="image2.jpg">
74
74
<img src="image1.jpg" alt="">
75
75
</picture>
76
76
```
@@ -94,9 +94,9 @@ Assuming three image “breakpoints” based on maximum widths, using pixel-base
94
94
** ` picture ` Element**
95
95
```
96
96
<picture>
97
- <source media="max-width: 400px" srcset="image1.jpg, image1-hd.jpg 2x">
98
- <source media="max-width: 600px" srcset="image2.jpg, image2-hd.jpg 2x">
99
- <source media="max-width: 800px" srcset="image3.jpg, image3-hd.jpg 2x">
97
+ <source media="( max-width: 400px) " srcset="image1.jpg, image1-hd.jpg 2x">
98
+ <source media="( max-width: 600px) " srcset="image2.jpg, image2-hd.jpg 2x">
99
+ <source media="( max-width: 800px) " srcset="image3.jpg, image3-hd.jpg 2x">
100
100
<img src="image1.jpg" alt="">
101
101
</picture>
102
102
```
@@ -113,8 +113,8 @@ Assuming two image sources indended for display on screen depending on window si
113
113
** ` picture ` Element**
114
114
```
115
115
<picture>
116
- <source media="( screen and min-width: 20em)" srcset="image1.jpg, image1-hd.jpg 2x">
117
- <source media="( screen and min-width: 40em)" srcset="image2.jpg, image2-hd.jpg 2x">
116
+ <source media="screen and ( min-width: 20em)" srcset="image1.jpg, image1-hd.jpg 2x">
117
+ <source media="screen and ( min-width: 40em)" srcset="image2.jpg, image2-hd.jpg 2x">
118
118
<source media="print" src="image3.jpg">
119
119
<img src="image1.jpg" alt="">
120
120
</picture>
@@ -174,8 +174,8 @@ Further discussion: <a href="http://lists.w3.org/Archives/Public/public-html/201
174
174
```
175
175
<picture>
176
176
<source src="image1.webp" type="image/webp">
177
- <source src="image2.jpg" media="min-width: 20em">
178
- <source src="image3.jpg" media="min-width: 40em">
177
+ <source src="image2.jpg" media="( min-width: 20em) ">
178
+ <source src="image3.jpg" media="( min-width: 40em) ">
179
179
<img src="image2.jpg" alt="">
180
180
</picture>
181
181
```
0 commit comments