The difference between max-device-width and max-width in a responsive Layout,

Source: Internet
Author: User

The difference between max-device-width and max-width in a responsive Layout,

I have studied the CSS of multi-screen adaptation and responsive layout.

First Writing Method
 1 @media screen and (max-device-width: 320px) { 2  3 } 4  5 @media screen and (min-device-width: 321px) and (max-device-width: 640px)  { 6  7 } 8  9 @media screen and (min-device-width: 641px) and (max-device-width: 1000px)  {10 11 }

 

Method 2
 1 @media screen and (max-device-width: 640px)  { 2      3     @media screen and (max-device-width: 320px) { 4          5     } 6      7     @media screen and (max-device-width: 360px)  { 8         9     }10 }11 12 @media screen and (min-device-width: 641px) and (max-device-width: 1000px)  {13 14 }

 

Differences between max-device-width and max-width
Max-device-width Max-width
Adapt to the width of the device Screen Adapt to the display area width
PC Browsers Do not respond when scaling at will The PC browser will respond when scaling at will
- Compatible with max-device-width

 

 Page example

 

Related Article

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.