How to detect screen size or resolution ?
Photo by Pixabay on Pexels.com

How to detect screen size or resolution ?

In many scenarios, we want to detect the screen size or resolution in our web app. The browser provides us ‘Screen’ object which contains screen-related information. to access screen object we can use screen or we can use window.screen

width and height are max width and height. But availHeight and availwidth are height and width available for view. You can check variation in availHeight and availwidth via changing position of taskbar of laptop from bottom to left or right.

when taskbar at bottom

After moving taskbar right

Zooming in out of browser size will not change screen width and height even availHeight and availWidth

Leave a Reply