* commit '74c890a57a819a0245573987455088c111e2c4eb': docs: fix snippet errors in web doc
This commit is contained in:
@@ -368,14 +368,14 @@ that the hdpi device shows a different image that's applied in CSS.</p>
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (-webkit-device-pixel-ratio: 1.5) {
|
@media screen and (-webkit-device-pixel-ratio: 1.5) {
|
||||||
// CSS for high-density screens
|
/* CSS for high-density screens */
|
||||||
#header {
|
#header {
|
||||||
background:url(high-density-image.png);
|
background:url(high-density-image.png);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (-webkit-device-pixel-ratio: 0.75) {
|
@media screen and (-webkit-device-pixel-ratio: 0.75) {
|
||||||
// CSS for low-density screens
|
/* CSS for low-density screens */
|
||||||
#header {
|
#header {
|
||||||
background:url(low-density-image.png);
|
background:url(low-density-image.png);
|
||||||
}
|
}
|
||||||
@@ -426,7 +426,7 @@ target to affect how your web page is scaled for different screen densities.</p>
|
|||||||
<pre>
|
<pre>
|
||||||
if (window.devicePixelRatio == 1.5) {
|
if (window.devicePixelRatio == 1.5) {
|
||||||
alert("This is a high-density screen");
|
alert("This is a high-density screen");
|
||||||
} else if (window.devicePixelRation == 0.75) {
|
} else if (window.devicePixelRatio == 0.75) {
|
||||||
alert("This is a low-density screen");
|
alert("This is a low-density screen");
|
||||||
}
|
}
|
||||||
</pre>
|
</pre>
|
||||||
|
|||||||
Reference in New Issue
Block a user