css判断iphoneX、iphoneXs、iphoneXsMax、iphoneXR
判断方法
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) {
...
}