-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
159 lines (144 loc) · 4.42 KB
/
index.html
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<html>
<head>
<title>Sensible HiDPI Media Queries</title>
<meta name="viewport" content="initial-scale=1.0,width=device-width">
<link href="styles.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="updated">Updated <strong>July 30, 2015</strong></div>
<h1 id="top">Sensible HiDPI Media Queries</h1>
<p>These are the results of my media query test for determining how to serve high-resolution assets to every browser. I’ve established a pixel ratio of 1.25x so that HiDPI assets are served to any display better than 1x. For more, read <a href="http://wp.me/pHPkU-16J">Making Sense of HiDPI Media Queries</a> on my blog. Or, <a href="test.html">view the test.</a></p>
<footer>
<h6>— <cite>Matt Miklic</cite></h6>
</footer>
<p>Skip to <a href="#ios">iOS</a> · <a href="#android">Android</a> · <a href="#osx">OS X</a> · <a href="#win">Windows</a></p>
<section>
<h2 id="syntax">Suggested Syntax</h2>
<p>For our media query, we combine the two rules that cover every browser, and add <code>print</code> so that high resolution assets are served when printing pages from your site.</p>
<pre><code>@media <span class="query">print</span>,
<span class="query">(-webkit-min-device-pixel-ratio: 1.25)</span>,
<span class="query">(min-resolution: 1.25dppx)</span> {
<span class="placeholder">/* Styles go here */</span>
}</code></pre>
</section>
<section>
<h2 id="ios">iOS <small><a href="#top">Back to Top</a></small></h2>
<table cellpadding="0" cellspacing="0">
<thead>
<!-- Results table headers -->
<tr>
<th> </th>
<th>min-resolution: 120dpi</th>
<th>min-resolution: 1.25dppx </th>
<th>webkit-min-device-pixel-ratio: 1.25 </th>
</tr>
</thead>
<tbody>
<tr>
<th>Safari 9<br /><small>iOS 9</small></th>
<td> </td>
<td> </td>
<td class="winner">✓<sup>1</sup></td>
</tr>
</tbody>
</table>
<p class="note"><sup>1</sup> All iOS browsers use the system WebKit engine, so support will be identical to Safari.</small><br />
</section>
<section>
<h2 id="android">Android <small><a href="#top">Back to Top</a></small></h2>
<table cellpadding="0" cellspacing="0">
<thead>
<!-- Results table headers -->
<tr>
<th> </th>
<th>min-resolution: 120dpi</th>
<th>min-resolution: 1.25dppx </th>
<th>webkit-min-device-pixel-ratio: 1.25 </th>
</tr>
</thead>
<tbody>
<tr>
<th>Chrome 44<br /><small>Android 5.1</small></th>
<td>✓</td>
<td class="winner">✓</td>
<td>✓</td>
</tr>
<tr>
<th>Firefox 39<br /><small>Android 5.1</small></th>
<td>✓</td>
<td class="winner">✓</td>
<td> </td>
</tr>
</tbody>
</table>
</section>
<section>
<h2 id="osx">OS X <small><a href="#top">Back to Top</a></small></h2>
<table cellpadding="0" cellspacing="0">
<thead>
<!-- Results table headers -->
<tr>
<th> </th>
<th>min-resolution: 120dpi</th>
<th>min-resolution: 1.25dppx</th>
<th>webkit-min-device-pixel-ratio: 1.25</th>
</tr>
</thead>
<tbody>
<tr id="chromemac">
<th>Chrome 44<br /><small>OS X 10.11</small></th>
<td>✓</td>
<td class="winner">✓</td>
<td>✓</td>
</tr>
<tr id="firefoxmac">
<th>Firefox 39<br /><small>OS X 10.11</small></th>
<td>✓</td>
<td class="winner">✓</td>
<td> </td>
</tr>
<tr id="safarimac">
<th>Safari 9<br /><small>OS X 10.11</small></th>
<td> </td>
<td> </td>
<td class="winner">✓</td>
</tr>
</tbody>
</table>
</section>
<section>
<h2 id="win">Windows <small><a href="#top">Back to Top</a></small></h2>
<table cellpadding="0" cellspacing="0">
<thead>
<!-- Results table headers -->
<tr>
<th> </th>
<th>min-resolution: 120dpi</th>
<th>min-resolution: 1.25dppx </th>
<th>webkit-min-device-pixel-ratio: 1.25 </th>
</tr>
</thead>
<tbody>
<tr>
<th>Chrome 44<br /><small>Windows 10</small></th>
<td>✓</td>
<td class="winner">✓</td>
<td>✓</td>
</tr>
<tr>
<th>Firefox 39<br /><small>Windows 10</small></th>
<td>✓</td>
<td class="winner">✓</td>
<td> </td>
</tr>
<tr>
<th>Microsoft Edge<br /><small>Windows 10</small></th>
<td>✓</td>
<td class="winner">✓</td>
<td>✓</td>
</tr>
</tbody>
</table>
</section>
</body>
</html>