What is the difference between max-device-width and max-width for mobile web?

前端 未结 8 1964
盖世英雄少女心
盖世英雄少女心 2020-11-22 08:56

I need to develop some html pages for iphone/android phones, but what is the difference between max-device-width and max-width? I need to use diffe

8条回答
  •  花落未央
    2020-11-22 09:46

    max-width is the width of the target display area, e.g. the browser; max-device-width is the width of the device's entire rendering area, i.e. the actual device screen.

    • If you are using the max-device-width, when you change the size of the browser window on your desktop, the CSS style won't change to different media query setting;

    • If you are using the max-width, when you change the size of the browser on your desktop, the CSS will change to different media query setting and you might be shown with the styling for mobiles, such as touch-friendly menus.

提交回复
热议问题