I read here that the width of the iPhone is 5 - 640 pixels. But it does not respond to media screen and (width: 640px) (it works on a computer with compression of the window). Why does the real width not match the one that the browser sees?

  • most likely you will find the answer here frontender.com.ua/mobile-web/wtf-viewport and it’s strange why you don’t use min-width and max-width, you just don’t come across any cases when you need an exact value for a media query - sivik_xes

1 answer 1

 @media screen and (width: 640px) 
 @media screen and (max-width: 640px) 

Well, do not forget about

 <meta name="viewport" content="width=device-width"> 
  • The question is still a bit different: why the number of pixels of the phone to which the media query responds is different from the real one? - Yuri
  • you have already been answered 2 times; viewport is cunning)
  • <meta name = "viewport" content = "width = device-width"> after such a line, in theory, should respond to width: 640px (exactly 640), but this does not happen - Yuri
  • Yes, maybe they even scored on this version of the rule, because no one uses it? Well, either go through the width. - Qwertiy
  • @Qwertiy And if you do not use this, then how many pixels wide should the maximum be considered a telephone? - Yuri