Skip to content

Commit 162443a

Browse files
committed
Rookie move, Wilto.
1 parent 1033e09 commit 162443a

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

UseCaseComparisons.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ Assuming three image “breakpoints” based on maximum widths, using pixel-base
66
**`picture` Element**
77
```
88
<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">
1212
<img src="image1.jpg" alt="">
1313
</picture>
1414
```
@@ -25,9 +25,9 @@ Assuming three image “breakpoints” intended to remain in sync with a media-q
2525
**`picture` Element**
2626
```
2727
<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">
3131
<img src="image1.jpg" alt="">
3232
</picture>
3333
```
@@ -43,9 +43,9 @@ Assuming three image “breakpoints” intended to remain in sync with a media-q
4343
**`picture` Element**
4444
```
4545
<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">
4949
<img src="image1.jpg" alt="">
5050
</picture>
5151
```
@@ -69,8 +69,8 @@ Assuming the author simply wants to preform image source swapping based on a dev
6969

7070
```
7171
<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">
7474
<img src="image1.jpg" alt="">
7575
</picture>
7676
```
@@ -94,9 +94,9 @@ Assuming three image “breakpoints” based on maximum widths, using pixel-base
9494
**`picture` Element**
9595
```
9696
<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">
100100
<img src="image1.jpg" alt="">
101101
</picture>
102102
```
@@ -113,8 +113,8 @@ Assuming two image sources indended for display on screen depending on window si
113113
**`picture` Element**
114114
```
115115
<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">
118118
<source media="print" src="image3.jpg">
119119
<img src="image1.jpg" alt="">
120120
</picture>
@@ -174,8 +174,8 @@ Further discussion: <a href="http://lists.w3.org/Archives/Public/public-html/201
174174
```
175175
<picture>
176176
<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)">
179179
<img src="image2.jpg" alt="">
180180
</picture>
181181
```

0 commit comments

Comments
 (0)