The difference between max (min)-device-width and Max (min)-width

Source: Internet
Author: User
Tags min
<! DOCTYPE html>

TINYSCREEN,CSS:

body{
	background:red;
}

SMALLSCREEN.CSS:

body{
	background:green;
}
CSS works when Min-width and Max-width are used.

----------------------------------------------------------------

<! DOCTYPE html>
CSS has no effect when using Min-device-width and Max-device-width.

----------------------------------------------------------------

Reason:

the difference between max-device-width and Max-width

Max-device-width and max-width are differentiated and behave in the following ways:

1, Max-device-width is the width of the entire display area of the device, for example, the actual screen width of the device.

2. Max-width is the width of the target display area, for example, the browser width.

3, if the use of max-device-width, then in the PC browser to browse the Web page, zoom out or enlarge the browser is not to do CSS, because "PC device" does not change. However, if you use Max-width to zoom in or out of the browser, the CSS is executed because the "display area" is the size of the browser.

4, if the use of max-device-width, then when the phone from vertical to horizontal, CSS is not executed, because "phone width" does not change. If you use Max-width, the CSS is executed when the phone is vertical, because the display area has changed.

5. In general, use Max-device-width for "mobile device" users and Max-width for "PC device" users.

Reference Links:

Click to open link




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.