Why is the screen size in the browser different from the actual one?

2

I'm lousy when it comes to HTML + CSS design, but as a web developer, I often find myself having to do it.

I often have to do the media-query to adjust the layout.

Question

  • If I have a mobile with resolution 360x592, why is it time to mount the media-query and resolution is 980x1413?
  • What is the relationship to this difference?
asked by anonymous 22.06.2017 / 16:11

2 answers

0

Guilherme, surely your problem is caused by pixel ratio , it changes the view of the pixels depending on the device, here's a great tip for you: link

So not only for mobile devices, but for desktop it is important to note that Chrome does a different analysis of Firefox for screen size on different operating systems, such as in Linux, where the sidebar of Ubuntu is taken into account by Chrome, but not by the little fox!

Complementary: link

    
22.06.2017 / 17:11
0

This happens because of the pixel ratio of your device. probably you are testing on a cell with pixel ratio 3, so while the screen is 360x592 , the pixels will behave like 980x1413

In practice, for the purpose of screen construction, there are 360x592 pixels. But each of these pixels represents 3x3 pixels on the physical device. This happens in devices of very high resolution, like Galaxy S4, HTC DROID DNA, etc. These pixels are used for visual enhancements, but are not available to the developer as a real 1 pixel line would be so thin it would not be visible.

More on link

    
22.06.2017 / 16:30