-
-
Save r3a1d3a1/a87a2f4e5edc95578400756e08826e63 to your computer and use it in GitHub Desktop.
DPR/Resolution/...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alert(`DPR: ${window.devicePixelRatio},\n` + | |
`screen.width: ${window.screen.width}, screen.height: ${window.screen.height},\n` + //Least useful | |
`availWidth: ${window.screen.availWidth}, availHeight: ${window.screen.availHeight},\n` + | |
`innerWidth: ${window.innerWidth}, innerHeight: ${window.innerHeight}`); //Media queries are based on this | |
// To match inner dimensions with screen dimensions on mobiles, you can add this in the header: | |
// <meta name="viewport" content="width=device-width,initial-scale=1"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment