问题
As from the title, I don't understand why the media query works on emulator device on Google Chrome and it doesn't work on a real mobile device.
Html meta tag
<meta name="viewport" content="width=max-width, initial-scale=1, maximum-scale=1, user-scalable=no">
Css:
@media screen and (min-device-width:640px) and (max-device-width:767px){...}
Actually I've set up the min and max resolutions from 640/768/850/1024 for mobile devices screen resolution, but it seems be an error, cause .... I don't understand yet
回答1:
You should apply device width in meta viewport
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
回答2:
The CSS should be like the following and check:
@media screen and (min-width:640px) and (max-width:767px){...}
来源:https://stackoverflow.com/questions/24329258/why-css-media-query-doesnt-work-on-mobile-device-but-yes-on-google-chrome-devic