Complete guide to accessing and utilizing screen information
screen.width × screen.height
screen.availWidth × screen.availHeight
screen.colorDepth
screen.pixelDepth
window.devicePixelRatio
screen.orientation.type
screen.width/height: The total physical dimensions of the user's screen in pixels.
screen.availWidth/availHeight: The screen dimensions available for your web application (excluding operating system interfaces like taskbars).
screen.colorDepth: The number of bits used to represent the color of a single pixel.
screen.pixelDepth: The color resolution in bits per pixel (usually same as colorDepth).
| Property | Description | Typical Values | Use Case |
|---|---|---|---|
screen.width |
Total screen width in pixels | 1920, 1366, 1440, etc. | Responsive design planning |
screen.height |
Total screen height in pixels | 1080, 768, 900, etc. | Full-screen applications |
screen.availWidth |
Available screen width | ~1920 (minus taskbar) | Window sizing |
screen.availHeight |
Available screen height | ~1040 (minus taskbar) | Popup positioning |
screen.colorDepth |
Color bit depth | 24, 30, 32 | Image optimization |
screen.pixelDepth |
Bits per pixel | 24, 30, 32 | Graphics optimization |