css判断iphoneX、iphoneXs、iphoneXsMax、iphoneXR
                                                        
                                
                                13045次阅读
                            
                            
                                
                                1068人点赞
                            
                            
                            
                                
                                发布时间: 2021-03-02 17:32:17
                            
                        
                        
                            
                                
                                扫码到手机查看
                                
                                    ![]() 
                                
                            
                        
                    判断方法
1、判断iphoneX、iphoneXs
//iphoneX、iphoneXs
// 设备屏幕可见宽度为375px, 可见高度为812px及设备像素比为3
@media only screen and (device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) {
   ...
}2、判断iphone Xs Max
//iphone Xs Max
@media only screen and (device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio:3) {
 ...
}3、iphone XR
//iphone XR
@media only screen and (device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio:2) {
 ...
} 
                     
                     
                     
                     
                     
                     
                     
             
             
             目录
        目录