iPhoneX 媒体查询适配的方法教程

2020-01-21 07:36:28于丽

 

复制代码 @media only screen and (min-device-width: 320px) and (max-device-height: 480px) and (-webkit-device-pixel-ratio: 1) { }

 

/* iphone 4 */

 

复制代码 @media only screen and (min-device-width: 320px) and (max-device-height: 480px) and (-webkit-device-pixel-ratio: 2) { }

 

/* iphone 5 */

 

复制代码 @media only screen and (min-device-width: 320px) and (max-device-height: 568px) and (-webkit-device-pixel-ratio: 2) { }

 

/* iphone 6, 6s */

 

复制代码 @media only screen and (min-device-width: 375px) and (max-device-height: 667px) and (-webkit-device-pixel-ratio: 2) { }

 

/* iphone 7, 8 */

 

复制代码 @media only screen and (min-device-width: 375px) and (max-device-height: 667px) and (-webkit-device-pixel-ratio: 2) { }