docs: fix snippet errors in web doc
Change-Id: I65648136c2df4bde5fa3bc3495f5166c4c87fe8a
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) {
|
||||
// CSS for high-density screens
|
||||
/* CSS for high-density screens */
|
||||
#header {
|
||||
background:url(high-density-image.png);
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (-webkit-device-pixel-ratio: 0.75) {
|
||||
// CSS for low-density screens
|
||||
/* CSS for low-density screens */
|
||||
#header {
|
||||
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>
|
||||
if (window.devicePixelRatio == 1.5) {
|
||||
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");
|
||||
}
|
||||
</pre>
|
||||
|
||||
Reference in New Issue
Block a user