Is there a way to judge the high split screen of the notebook at the front end?

for example, the 14-inch 1920-1080 notebook screen, the web page font will be very small on this screen. Is there a way to judge
js and adjust the font accordingly? The magnification function of the browser does not count.

Mar.11,2021

Google for a while, the high-score screen is the same concept as the Retina screen.
based on the experience of adapting Retina screens on mobile devices, I should be able to solve this problem by modifying the scaling of viewport.

first of all, let's be clear about the problem to be solved:

  1. how to distinguish between a high-resolution screen and an ordinary screen;
  2. how to zoom the high-split screen.

solution

  1. get window.devicePixelRatio , also known as dpr. A value of 1 is a normal screen, and a screen greater than 1 is a high-score screen.
  2. set the meta tag:

      

    Media query @ media

Menu