iphoneX 顶部底部适配
2020-09-26 本文已影响0人
TouchMe丶
<meta name="viewport" content="..., viewport-fit=cover" />
/* 适配iphoneX顶部填充/
@supports (top: env(safe-area-inset-top)){
body,
.header{
padding-top: constant(safe-area-inset-top);
padding-top: env(safe-area-inset-top);
}
}
/ 判断iphoneX 将 footer 的 padding-bottom 填充到最底部 */
@supports (bottom: env(safe-area-inset-bottom)){
body,
.footer{
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
}
}