Skip to content

Commit 554ad15

Browse files
committed
Now really - Fixed some typos. Added to code sections. Fixed some of the example code
1 parent 6c3d209 commit 554ad15

File tree

2 files changed

+34
-40
lines changed

2 files changed

+34
-40
lines changed

UseCaseComparisons.md

Lines changed: 34 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,27 @@ This document is indended to address the use cases addressed by both the `pictur
44
Assuming three image “breakpoints” based on maximum widths, using pixel-based values: 400px, 600px, and 800px. The smallest image source has been designated as fallback content.
55

66
**`picture` Element*
7-
<picture>
7+
`<picture>
88
<source media="max-width: 400px" src="image1.jpg">
99
<source media="max-width: 600px" src="image2.jpg">
1010
<source media="max-width: 800px" src="image3.jpg">
1111
<img src="image1.jpg" alt="">
12-
</picture>
12+
</picture>`
1313

1414
**Extended `srcset`**
15-
<img src="image1.jpg" srcset="image1.jpg, image1.jpg 400w, image2.jpg 600w" alt="">
15+
`<img src="image1.jpg" srcset="image1.jpg, image1.jpg 400w, image2.jpg 600w" alt="">`
1616

1717

1818
### Using min-width ###
1919
Assuming three image “breakpoints” intended to remain in sync with a media-query-based CSS layout making use of `min-width` media queries.
2020

2121
**`picture` Element**
22-
<picture>
23-
<source media="max-width: 400px" src="image1.jpg">
24-
<source media="max-width: 600px" src="image2.jpg">
25-
<source media="max-width: 800px" src="image3.jpg">
22+
`<picture>
23+
<source media="min-width: 400px" src="image1.jpg">
24+
<source media="min-width: 600px" src="image2.jpg">
25+
<source media="min-width: 800px" src="image3.jpg">
2626
<img src="image1.jpg" alt="">
27-
</picture>
27+
</picture>`
2828

2929
**Extended `srcset`**
3030
N/A
@@ -34,67 +34,74 @@ N/A
3434
Assuming three image “breakpoints” intended to remain in sync with a media-query-based layout specced in `em` units.
3535

3636
**`picture` Element**
37-
<picture>
37+
`<picture>
3838
<source media="max-width: 20em" src="image1.jpg">
3939
<source media="max-width: 40em" src="image2.jpg">
4040
<source media="max-width: 60em" src="image3.jpg">
4141
<img src="image1.jpg" alt="">
42-
</picture>
42+
</picture>`
4343

4444
**Extended `srcset`**
4545
N/A
4646

4747
Note: the `em` values above could be manually converted to `px` by the author to ensure that the image breakpoints are within a few pixels of the `em`-based layout media queries, resulting in:
4848

49-
<img src="image1.jpg" srcset="image1.jpg 320w, image1.jpg 640w, image2.jpg 960w" alt="">
49+
`<img src="image1.jpg" srcset="image1.jpg 320w, image1.jpg 640w, image2.jpg 960w" alt="">`
5050

5151
While the `em`-based CSS layout will be reevaulated based on user zoom in all modern browsers (see http://blog.cloudfour.com/the-ems-have-it-proportional-media-queries-ftw/ for a description and functional example) and we can assume the same for the `em`-based image breakpoints, the `px`-based image breakpoints will fall out of sync with the layout when the user zooms in or out.
5252

5353
## Portait vs. Landscape Orientation ##
5454
[]
5555

5656
**`picture` Element**
57-
<picture>
57+
`<picture>
5858
<source media="device-orientation: portrait" src="image1.jpg">
5959
<source media="device-orientation: landscape" src="image2.jpg">
6060
<img src="image1.jpg" alt="">
61-
</picture>
61+
</picture>`
6262

6363
**Extended `srcset`**
6464
N/A
6565

6666

6767
## Display Density
68-
The two proposals are functionally identical in terms of dealing with display density when independent of the “Viewport Sizes” use case above:
68+
The two proposals are functionally identical in terms of dealing with display density when independent of the “Viewport Sizes” use case:
69+
70+
**`picture` Element**
71+
`<picture>
72+
<source srcset="image1.jpg, image2.jpg 2x">
73+
<img src="image1.jpg" alt="">
74+
</picture>`
6975

70-
<img src="image1.jpg" srcset="image2.jpg 2x">
76+
**Extended `srcset`**
77+
`<img src="image1.jpg" srcset="image2.jpg 2x">`
7178

7279

7380
## Display density in conjunction with viewport sizing ##
7481
Assuming three image “breakpoints” based on maximum widths, using pixel-based values: 400px, 600px, and 800px. The smallest standard resolution image source has been designated as fallback content.
7582

7683
**`picture` Element**
77-
<picture>
84+
`<picture>
7885
<source media="max-width: 400px" srcset="image1.jpg, image1-hd.jpg 2x">
7986
<source media="max-width: 600px" srcset="image2.jpg, image2-hd.jpg 2x">
8087
<source media="max-width: 800px" srcset="image3.jpg, image3-hd.jpg 2x">
8188
<img src="image1.jpg" alt="">
82-
</picture>
89+
</picture>`
8390

8491
**Extended `srcset`**
85-
<img src="image1.jpg" srcset="image1.jpg 400w, image1-hd.jpg 400w 2x, image2.jpg 600w, image2-hd.jpg 600w 2x, image3.jpg 800w, image3-hd.jpg 800w 2x" alt="">
92+
`<img src="image1.jpg" srcset="image1.jpg 400w, image1-hd.jpg 400w 2x, image2.jpg 600w, image2-hd.jpg 600w 2x, image3.jpg 800w, image3-hd.jpg 800w 2x" alt="">`
8693

8794

8895
## Print sources
8996
Assuming two image sources indended for display on screen depending on window size, each with a standard and high-definition source, and a single image source intended for printing.
9097

9198
**`picture` Element**
92-
<picture>
99+
`<picture>
93100
<source media="(screen and min-width: 20em)" srcset="image1.jpg, image1-hd.jpg 2x">
94101
<source media="(screen and min-width: 40em)" srcset="image2.jpg, image2-hd.jpg 2x">
95102
<source media="print" src="image3.jpg">
96103
<img src="image1.jpg" alt="">
97-
</picture>
104+
</picture>`
98105

99106
**Extended `srcset`**
100107
N/A
@@ -103,11 +110,11 @@ N/A
103110
This is based on the high-contrast mode and ambient light media queries currently being proposed in the CSS WG.
104111

105112
**`picture` Element**
106-
<picture>
113+
`<picture>
107114
<source media="" srcset="image1.jpg">
108115
<source media="" srcset="image2.jpg">
109116
<img src="image1.jpg" alt="">
110-
</picture>
117+
</picture>`
111118

112119
**Extended `srcset`**
113120
N/A
@@ -122,11 +129,12 @@ N/A
122129
## Potential for addressing new image formats
123130

124131
**`picture` Element**
125-
<picture>
126-
<source media="image2.webp" type="image/webp">
127-
<source media="image1.jpg">
132+
`<picture>
133+
<source src="image2.webp" type="image/webp">
134+
<source src="image1.jpg">
128135
<img src="image1.jpg" alt="">
129-
</picture>
136+
</picture>`
130137

131138
**Extended `srcset`**
139+
N/A
132140

implementation_plan.md

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)