How reliable is screen.width and screen.height?

I would like to make a web application with a “responsive design” to send the screen resolution to the server and make decisions based on this information, but the question is, can I rely on window.screen to always provide the right laptop, tablet smartphone information?

And of course, given that it only supports modern browsers and devices.

+4
source share
1 answer

Yes, screen.width and screen.height are reliable, however you are probably more interested in the size of the window for placing your pages. For example, @media queries in CSS3 use window size rather than screen size.

+1
source

Source: https://habr.com/ru/post/1390121/


All Articles