// 兼容iphonex
@media only screen and (device-width:375px) and (device-height:812px) and (-webkit-device-pixel-ratio:3) {
.iphonex{padding-top:88px;padding-bottom:34px;}
.iphonex::before{content:'',display:block;position:absolute;width:100%;height:88px;background-color:#393c44;top:0;left:0;z-index:999;}
.iphonex::after{content:'',display:block;position:absolute;width:100%;height:44px;background-color:#393c44;bottom:0;left:0;z-index:999;}
}
// 兼容iphone6/7/8
@media only screen and (device-width:375px) and (device-height:667px) and (-webkit-device-pixel-ratio:2) {
.iphone6{padding-top:44px;}
.iphone6::before{content:'',display:block;position:absolute;width:100%;height:44px;background-color:#393c44;top:0;left:0;z-index:999;}
}
// 兼容iphone6plus/7plus/8plus
@media only screen and (device-width:414px) and (device-height:763px) and (-webkit-device-pixel-ratio:3) {
.iphone6{padding-top:50px;}
.iphone6::before{content:'',display:block;position:absolute;width:100%;height:50px;background-color:#393c44;top:0;left:0;z-index:999;}
}
<body class="iphonex iphone6"></body>